/* ═══ VARIABLES ══════════════════════════════════════════════════════════════ */
:root {
  --navy:        #1a3f98;
  --navy-dark:   #132e72;
  --navy-light:  #2a52b8;
  --navy-bg:     #eef1f9;
  --gold:        #f5a800;
  --gold-light:  #ffc533;
  --gold-pale:   #fff8e7;
  --bg:          #f0f2f7;
  --surface:     #ffffff;
  --border:      #dde2ec;
  --text:        #1a1f36;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --sidebar-w:   232px;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 2px 8px rgba(26,63,152,.08);
  --shadow-md:   0 4px 16px rgba(26,63,152,.12);
  --green:       #16a34a;
  --green-bg:    #f0fdf4;
  --red:         #dc2626;
  --red-bg:      #fef2f2;
  --orange:      #ea580c;
  --ig:          #e1306c;
  --tt:          #7c3aed;
  --yt:          #dc2626;
}

/* ═══ RESET ══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.muted { color: var(--text-muted); }

/* ═══ LAYOUT ═════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 300;
  overflow-y: auto;
}
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px 32px;
}

/* ═══ SIDEBAR ════════════════════════════════════════════════════════════════ */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-logo img {
  height: 30px;
  filter: brightness(0) invert(1);
}
.sidebar-app-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .65;
}

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: rgba(255,255,255,.78);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-weight: 700;
  border-right: 3px solid var(--gold);
}
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 8px 0; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.nav-badge-gold  { background: var(--gold); color: var(--navy-dark); }
.nav-badge-blue  { background: #3b82f6; color: #fff; }
.nav-badge-muted { background: rgba(255,255,255,.15); }

.sidebar-divider {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 8px 16px;
}
.nav-item-external {
  opacity: 0.75;
  font-size: 13px;
}
.nav-item-external:hover { opacity: 1; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info span {
  font-size: 11px;
  color: rgba(255,255,255,.55);
}
.sidebar-logout {
  color: rgba(255,255,255,.4);
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.sidebar-logout:hover { color: rgba(255,255,255,.9); text-decoration: none; }

/* ═══ MOBILE TOPBAR ══════════════════════════════════════════════════════════ */
.topbar-mobile {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--navy);
  padding: 12px 16px;
  margin: -28px -32px 24px;
}
.sidebar-toggle {
  background: none;
  border: none;
  color: #fff;
  padding: 4px;
}
@media (max-width: 768px) {
  .main-content { margin-left: 0; padding: 0 16px 24px; }
  .topbar-mobile { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
}

/* ═══ FLASH ══════════════════════════════════════════════════════════════════ */
.flash-container { margin-bottom: 20px; }
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 8px;
}
.flash button {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  opacity: .5;
  color: inherit;
  padding: 0 2px;
}
.flash-success { background: var(--green-bg); border: 1px solid #bbf7d0; color: var(--green); }
.flash-error   { background: var(--red-bg);   border: 1px solid #fecaca; color: var(--red); }
.flash-info    { background: var(--navy-bg);   border: 1px solid #bfdbfe; color: var(--navy); }

/* ═══ PAGE HEADER ════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--text); }
.page-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ═══ BUTTONS ════════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--navy-light); color: #fff; text-decoration: none; }
.btn-primary.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-outline:hover { border-color: var(--navy); background: var(--navy-bg); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  background: var(--red-bg);
  color: var(--red);
  border: 1.5px solid #fecaca;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: #fee2e2; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  text-decoration: none;
}
.btn-icon:hover { color: var(--navy); border-color: var(--navy); background: var(--navy-bg); text-decoration: none; }
.btn-icon-danger:hover { color: var(--red); border-color: #fecaca; background: var(--red-bg); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.badge-gold { background: var(--gold-pale); color: var(--navy-dark); }
.badge-navy { background: var(--navy-bg); color: var(--navy); }
.badge-tt   { background: #ede9fe; color: #5b21b6; }

/* ═══ DATA TABLE ═════════════════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f9fafb; }

/* ═══ CARDS ══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.link-small {
  font-size: 12px;
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
}

/* ═══ PLATFORM CARDS ═════════════════════════════════════════════════════════ */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--border);
}
.platform-card.platform-ig { border-top-color: var(--ig); }
.platform-card.platform-tt { border-top-color: var(--tt); }
.platform-card.platform-yt { border-top-color: var(--yt); }

.platform-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.platform-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ig-color { background: #fce7f0; color: var(--ig); }
.tt-color { background: #ede9fe; color: var(--tt); }
.yt-color { background: #fee2e2; color: var(--yt); }

.platform-name { font-size: 15px; font-weight: 700; color: var(--text); }
.platform-updated { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.platform-card-header .btn-icon { margin-left: auto; }

.metric-row-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 8px;
  margin-bottom: 16px;
}
.metric-cell { text-align: center; }
.metric-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.metric-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

.chart-mini {
  height: 52px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ═══ TWO COLUMN ═════════════════════════════════════════════════════════════ */
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

/* ═══ TASK PREVIEW ═══════════════════════════════════════════════════════════ */
.task-preview-list { list-style: none; }
.task-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.task-preview-item:last-child { border-bottom: none; }
.task-preview-body { flex: 1; min-width: 0; }
.task-preview-title { font-size: 13.5px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-preview-meta  { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.task-due { font-size: 11px; color: var(--text-muted); }

.task-check-btn {
  background: none;
  border: none;
  padding: 2px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color .15s;
}
.task-check-btn:hover { color: var(--green); }
.task-check-btn.checked { color: var(--green); }

/* ═══ BRIEFING PREVIEW ═══════════════════════════════════════════════════════ */
.briefing-preview-list { display: flex; flex-direction: column; gap: 8px; }
.briefing-preview-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.briefing-preview-item:hover { border-color: var(--navy); background: var(--navy-bg); text-decoration: none; }
.briefing-pin-dot { font-size: 14px; flex-shrink: 0; }
.briefing-preview-title  { font-size: 13px; font-weight: 700; color: var(--text); }
.briefing-preview-excerpt { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.briefing-preview-date   { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ═══ EMPTY STATE ════════════════════════════════════════════════════════════ */
.empty-state { font-size: 13px; color: var(--text-muted); text-align: center; padding: 16px 0; }
.empty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-card p { color: var(--text-muted); font-size: 14px; }

/* ═══ PLATFORM TAGS ══════════════════════════════════════════════════════════ */
.platform-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}
.platform-tag-instagram { background: #fce7f0; color: var(--ig); }
.platform-tag-tiktok    { background: #ede9fe; color: var(--tt); }
.platform-tag-youtube   { background: #fee2e2; color: var(--yt); }
.platform-tag-allgemein { background: var(--navy-bg); color: var(--navy); }

/* ═══ STATUS BADGES ══════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-offen     { background: #fff3cd; color: #92400e; }
.status-in_arbeit { background: #dbeafe; color: #1e40af; }
.status-erledigt  { background: var(--green-bg); color: var(--green); }

/* ═══ TASKS TABLE ════════════════════════════════════════════════════════════ */
.task-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.task-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}
.task-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.task-row:last-child td { border-bottom: none; }
.task-row:hover td { background: var(--bg); }
.task-row.task-done td { opacity: .55; }
.task-check-cell { width: 40px; text-align: center; }
.task-title-text { font-weight: 600; display: block; }
.task-notes-preview { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.task-due-cell { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.overdue { color: var(--red); font-weight: 600; }
.task-actions-cell { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* ═══ FILTER BAR ═════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.filter-group { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ═══ BRIEFINGS GRID ═════════════════════════════════════════════════════════ */
.briefings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.briefing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.briefing-card.pinned {
  border-color: var(--gold);
  background: var(--gold-pale);
}
.briefing-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.briefing-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pin-icon { font-size: 13px; }
.briefing-card-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.briefing-card-content {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  flex: 1;
}
.briefing-card-footer {
  font-size: 11px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.inline-form { display: inline; }

/* ═══ FORMS ══════════════════════════════════════════════════════════════════ */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 720px;
  box-shadow: var(--shadow);
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,63,152,.1);
}
.form-group textarea { resize: vertical; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.form-group-inline { display: flex; align-items: center; gap: 10px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.back-link { font-size: 13px; color: var(--navy); font-weight: 600; }

/* ═══ MODAL ══════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
}
.modal-close:hover { color: var(--text); }
.modal-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-fields .form-group { margin-bottom: 0; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ═══ LOGIN ══════════════════════════════════════════════════════════════════ */
.login-page {
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrap { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}
.login-logo img { height: 36px; }
.login-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  color: var(--navy);
  margin-bottom: 4px;
}
.login-sub {
  font-size: 12.5px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.login-form .form-group { margin-bottom: 14px; }

/* ═══ KPI ROW ════════════════════════════════════════════════════════════════ */
.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 130px;
  flex: 1;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--border);
}
.kpi-card.kpi-ig  { border-top-color: #e1306c; }
.kpi-card.kpi-tt  { border-top-color: #7c3aed; }
.kpi-card.kpi-yt  { border-top-color: #dc2626; }
.kpi-card.kpi-pos { border-top-color: var(--green); }
.kpi-val   { font-size: 22px; font-weight: 800; color: var(--text); }
.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-top: 2px; }

/* ═══ CHART GRID (helles Theme) ══════════════════════════════════════════════ */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.chart-card.full { grid-column: 1 / -1; }
.chart-card h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.chart-container { position: relative; height: 180px; }
.no-data-note { color: var(--text-muted); font-size: 13px; padding: 12px 0 24px; }

/* ═══ META ADS ═══════════════════════════════════════════════════════════════ */
.ads-list { display: flex; flex-direction: column; gap: 10px; }
.ad-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}
.ad-medal { font-size: 18px; flex-shrink: 0; width: 26px; text-align: center; }
.ad-body  { flex: 1; min-width: 0; }
.ad-name  { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-campaign { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-stats { display: flex; gap: 12px; flex-shrink: 0; }
.ad-stat  { display: flex; flex-direction: column; align-items: center; }
.ad-stat strong { font-size: 13px; font-weight: 800; color: var(--navy); }
.ad-stat small  { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ═══ PLATFORM TAG — ADS ═════════════════════════════════════════════════════ */
.platform-tag-ads { background: #fff3cd; color: #92400e; }

/* ═══ IDEEN-AKTIONEN ═════════════════════════════════════════════════════════ */
.idea-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ai-btn-group { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-idea-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  transition: all .15s;
  white-space: nowrap;
}
.btn-to-task {
  background: var(--navy-bg);
  border-color: var(--navy);
  color: var(--navy);
}
.btn-to-task:hover { background: var(--navy); color: #fff; }
.btn-ai {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: #92400e;
}
.btn-ai:hover { background: var(--gold); color: var(--navy-dark); }
.btn-ai-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ai-secondary:hover { border-color: var(--gold); color: #92400e; background: var(--gold-pale); }

.briefing-card.converted { opacity: .65; }
.briefing-card.converted .briefing-card-title { text-decoration: line-through; text-decoration-color: var(--green); }

/* ═══ KI SKRIPT OUTPUT ═══════════════════════════════════════════════════════ */
.ai-script-output {
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

/* ═══ SPINNER ════════════════════════════════════════════════════════════════ */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ ADS GRID (breiter) ═════════════════════════════════════════════════════ */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .ads-grid { grid-template-columns: 1fr; }
}
.ad-row-wide {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.ad-row-wide:last-child { margin-bottom: 0; }
.ad-name-full {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
}

/* ═══ TRENDS ════════════════════════════════════════════════════════════════ */
.insp-keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.chip-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 2px;
}
.kw-chip {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.kw-chip:hover, .kw-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.insp-results-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.trend-card {
  padding: 0;
  overflow: hidden;
}
.trend-card-inner {
  display: flex;
  gap: 0;
}
.trend-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  height: 100px;
  display: block;
  overflow: hidden;
  background: #000;
}
.trend-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.trend-thumb-wrap:hover .trend-thumb { opacity: 1; }
.trend-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  pointer-events: none;
}
.trend-info {
  padding: 12px 16px;
  flex: 1;
  min-width: 0;
}
.trend-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.trend-rank {
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.trend-kw-badge {
  background: rgba(245,168,0,0.15);
  color: var(--gold-dark, #c68a00);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.trend-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.trend-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.trend-title:hover { color: var(--navy); text-decoration: underline; }
.trend-channel {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.trend-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.trend-stats span { display: flex; align-items: center; gap: 3px; }
.trend-analysis {
  border-top: 1px solid var(--border);
  padding: 16px 16px 12px;
  background: var(--bg);
}
@media (max-width: 640px) {
  .trend-thumb-wrap { width: 100px; height: 80px; }
  .trend-info { padding: 10px 12px; }
}

.trends-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--navy);
}
.trends-section-icon { font-size: 16px; }
.trends-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ═══ TREND CHECKBOX & AUSWAHL-LEISTE ══════════════════════════════════════ */
.trend-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0 4px;
}
.trend-checkbox { display: none; }
.trend-checkbox-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.trend-checkbox:checked + .trend-checkbox-box {
  background: var(--navy);
  border-color: var(--navy);
}
.trend-checkbox:checked + .trend-checkbox-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}
.trend-checkbox-wrap:hover .trend-checkbox-box {
  border-color: var(--navy);
}
.trend-card:has(.trend-checkbox:checked) {
  border-color: var(--navy) !important;
  background: rgba(26,63,152,0.03);
}
#trends-selection-bar {
  position: sticky;
  bottom: 16px;
  z-index: 100;
  margin-top: 12px;
}
.trends-sel-inner {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(26,63,152,0.35);
  font-size: 13px;
  font-weight: 600;
}
.trends-sel-inner .btn-outline {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  font-size: 12px;
  padding: 4px 10px;
}
.trends-sel-inner .btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}
.trends-sel-inner .btn-primary {
  background: var(--gold);
  color: var(--navy);
  font-size: 13px;
}
.trends-sel-inner .btn-primary:hover {
  background: #e09600;
}
.trend-analysis-slot:empty { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   MARKETING DASHBOARD — Plattform-spezifische KPI-Farben
═══════════════════════════════════════════════════════════════════════════ */
.kpi-card.kpi-meta  { border-top-color: #6366f1; }
.kpi-card.kpi-ga4   { border-top-color: #16a34a; }
.kpi-card.kpi-gads  { border-top-color: #4285f4; }
.kpi-card.kpi-lm    { border-top-color: #d97706; }

/* Abgeleitete Werte-Farben */
.val-pos    { color: #16a34a; font-weight: 700; }
.val-neg    { color: var(--red); font-weight: 700; }
.val-gold   { color: #b45309; font-weight: 700; }
.val-blue   { color: #1d4ed8; font-weight: 700; }
.val-purple { color: #7c3aed; font-weight: 700; }
.val-dim    { color: var(--text-muted); }

/* ═══ INFO-BLÖCKE (Budget-Diagnose, ROAS, CPS, etc.) ════════════════════ */
.info-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}
.info-block.info-gold   { border-left-color: var(--gold); }
.info-block.info-purple { border-left-color: #7c3aed; }
.info-block.info-green  { border-left-color: var(--green); }
.info-block.info-blue   { border-left-color: #2563eb; }
.info-block.info-red    { border-left-color: var(--red); }

.info-block-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-block.info-gold   .info-block-title { color: #b45309; }
.info-block.info-purple .info-block-title { color: #6d28d9; }
.info-block.info-green  .info-block-title { color: var(--green); }
.info-block.info-blue   .info-block-title { color: #1d4ed8; }
.info-block.info-red    .info-block-title { color: var(--red); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.info-item { }
.info-item .item-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.info-item .item-val   { font-size: 18px; font-weight: 800; color: var(--text); }
.info-item .item-note  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ═══ INLINE FORM (Sales-Eingabe, TikTok-Upload) ════════════════════════ */
.inline-form {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}
.inline-form .form-label-small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.form-field input,
.form-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--navy);
}
.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold);
  color: var(--navy-dark);
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s;
}
.btn-save:hover { background: #e09600; }
.btn-reset-small {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid #fecaca;
  border-radius: 4px;
  color: var(--red);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  transition: background .15s;
}
.btn-reset-small:hover { background: var(--red-bg); }

/* ═══ MARKETING CAMPAIGN ROW ════════════════════════════════════════════ */
.campaign-row-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 8px;
}
.campaign-row-entry:last-child { border-bottom: none; }
.campaign-name { flex: 1; color: var(--text); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-stats { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }

/* ═══ HIGHLIGHT-CARD (Top-Ad) ═══════════════════════════════════════════ */
.top-ad-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 8px;
}
.top-ad-label { font-size: 10px; font-weight: 800; color: #b45309; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.top-ad-name  { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.top-ad-campaign { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.top-ad-stats { display: flex; gap: 14px; font-size: 12px; flex-wrap: wrap; }
.top-ad-stats span { color: var(--text-muted); }
.top-ad-stats strong { color: var(--text); }

/* ═══ MONATLICHE ZUSAMMENFASSUNG (Analytik) ═════════════════════════════ */
.monthly-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.monthly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.monthly-table th {
  padding: 9px 12px;
  text-align: right;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.monthly-table th:first-child { text-align: left; }
.monthly-table td {
  padding: 9px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.monthly-table td:first-child { text-align: left; font-weight: 600; }
.monthly-table tbody tr:last-child td { border-bottom: none; }
.monthly-table .month-row { cursor: pointer; }
.monthly-table .month-row:hover td { background: #f8f9fc; }
.expand-arrow {
  display: inline-block;
  width: 16px;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform .2s;
  margin-right: 4px;
}
.expand-arrow.open { transform: rotate(90deg); color: var(--navy); }

.campaign-detail-row td { padding: 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.campaign-breakdown { padding: 12px 16px 10px; }
.campaign-breakdown-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.inner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.inner-table th {
  padding: 5px 10px;
  color: var(--text-muted);
  font-size: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: right;
  background: transparent;
}
.inner-table th:first-child { text-align: left; }
.inner-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: right;
}
.inner-table td:first-child { text-align: left; font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inner-table tr:last-child td { border-bottom: none; }
.inner-table tfoot tr td { background: var(--bg); font-weight: 700; border-top: 2px solid var(--border); }
.campaign-note { font-size: 10px; color: var(--text-muted); padding: 4px 10px 6px; font-style: italic; }

.btn-backfill {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: none;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.btn-backfill:hover { color: var(--navy); border-color: var(--navy); text-decoration: none; }

/* ═══ TIKTOK UPLOAD ══════════════════════════════════════════════════════ */
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s;
}
.file-label:hover { border-color: var(--navy); color: var(--navy); }
.file-label input[type=file] { display: none; }

/* ═══ REMINDER BANNER ═══════════════════════════════════════════════════ */
.reminder-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 10px;
}
.reminder-banner.urgent   { background: #fffbeb; border: 1px solid #f59e0b; color: #92400e; }
.reminder-banner.upcoming { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }

/* ═══ NO-DATA ════════════════════════════════════════════════════════════ */
.no-data { color: var(--text-muted); font-size: 13px; padding: 16px 0; text-align: center; }

/* ═══ SECTION LABEL MIT ICON ════════════════════════════════════════════ */
.section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 28px 0 12px;
}
.section-label:first-child { margin-top: 0; }

/* ═══ TIKTOK CURRENT WEEK BADGE ════════════════════════════════════════ */
.badge-current {
  font-size: 10px;
  font-weight: 700;
  background: var(--navy-bg);
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ═══ ERROR CARD ════════════════════════════════════════════════════════ */
.error-card-light {
  background: var(--red-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Landing Page Analytics ─────────────────────────────────────────────── */
.lp-kpi-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-2, #f8fafc);
  border-radius: 8px;
  padding: 8px 12px;
}
.lp-kpi-val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.lp-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.btn-outline.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
