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

/* ── Custom properties ─────────────────────────────────────────────────────── */
:root {
  --primary:        #5B21B6;
  --primary-mid:    #7C3AED;
  --primary-light:  #EDE9FE;
  --primary-pale:   #F5F3FF;
  --accent-gradient: linear-gradient(135deg, #4F46E5 0%, #9333EA 100%);

  --bg:             #ECEEF8;
  --surface:        #FFFFFF;
  --surface-alt:    #F9FAFB;
  --surface-input:  #F3F4F6;

  --border:         #E5E7EB;
  --border-focus:   #7C3AED;

  --text:           #111827;
  --text-muted:     #6B7280;
  --text-dim:       #9CA3AF;

  --error:          #DC2626;
  --error-light:    #FEF2F2;
  --success:        #059669;
  --success-light:  #ECFDF5;
  --warning:        #92400E;
  --warning-light:  #FFFBEB;

  --radius:         1rem;
  --radius-sm:      0.625rem;
  --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);

  --font: 'DM Sans', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── App shell ─────────────────────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Login screen ──────────────────────────────────────────────────────────── */
.login-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  animation: fadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-logo {
  width: 52px;
  height: 52px;
  background: var(--accent-gradient);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto 1.5rem;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ── Tab nav ───────────────────────────────────────────────────────────────── */
.tab-nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
}

.tab-nav-pills {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav-pills::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: var(--primary-pale); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }

/* ── Main content ──────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.layout-container {
  padding: 1.75rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card + .card { margin-top: 1.25rem; }

.card-heading {
  font-size: 1.1rem;
  font-weight: 700;
  padding-left: 0.875rem;
  border-left: 4px solid var(--primary-mid);
  margin-bottom: 0.5rem;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* ── Stat cards (dashboard) ────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ── Content grids ─────────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  background: var(--surface-alt);
  padding: 0.65rem 0.875rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--primary-pale); }

td {
  padding: 0.65rem 0.875rem;
  vertical-align: middle;
}

.td-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  background: var(--surface-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.field.has-error input,
.field.has-error select {
  border-color: var(--error);
}

.field-error {
  font-size: 0.75rem;
  color: var(--error);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.checkbox-row input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-mid);
  cursor: pointer;
}

.checkbox-row label {
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

/* ── Search bar ────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.search-bar svg { color: var(--text-dim); flex-shrink: 0; }
.search-bar input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--text);
  padding: 0.6rem 0;
  width: 240px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary.full-width { width: 100%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--primary-mid);
  border: 1.5px solid var(--primary-mid);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--primary-pale); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--error-light);
  color: var(--error);
  border: 1.5px solid #FECACA;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: none;
  color: var(--primary-mid);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-text:hover { background: var(--primary-pale); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: none;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-info    { background: var(--primary-light); border-color: #C4B5FD; color: var(--primary); }
.alert-error   { background: var(--error-light);   border-color: #FECACA; color: var(--error); }
.alert-success { background: var(--success-light); border-color: #A7F3D0; color: var(--success); }
.alert-warning { background: var(--warning-light); border-color: #FDE68A; color: var(--warning); }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-green  { background: var(--success-light); color: var(--success); }
.badge-red    { background: var(--error-light);   color: var(--error); }
.badge-purple { background: var(--primary-light); color: var(--primary); }
.badge-gray   { background: var(--surface-alt);   color: var(--text-muted); }

/* ── Stars ─────────────────────────────────────────────────────────────────── */
.stars {
  color: #F59E0B;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

/* ── Status dot ────────────────────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.is-set  { background: var(--success); }
.status-dot.not-set { background: var(--error); }
.status-dot.gray    { background: var(--text-dim); }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  gap: 0.35rem;
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 500;
  animation: fadeUp 0.2s ease both;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  animation: fadeUp 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
}

.modal-lg {
  max-width: 720px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  padding-left: 0.875rem;
  border-left: 4px solid var(--primary-mid);
}

.modal-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--surface-alt);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s;
}
.modal-close:hover { background: var(--border); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Detail section (user detail modal) ─────────────────────────────────────── */
.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.detail-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.detail-item {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.875rem;
}

.detail-item-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.detail-item-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.achievement-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.achievement-chip {
  background: var(--primary-pale);
  border: 1px solid var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Bar chart (activity) ──────────────────────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding-top: 0.25rem;
}

.bar {
  flex: 1;
  background: var(--primary-light);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: background 0.15s;
  cursor: default;
  position: relative;
}
.bar:hover { background: var(--primary-mid); }
.bar:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 0.7rem;
  white-space: nowrap;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

/* ── Language row ──────────────────────────────────────────────────────────── */
.lang-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.lang-row:last-child { border-bottom: none; }

.lang-flag {
  font-size: 1.4rem;
  line-height: 1;
}

.lang-info { flex: 1 }

.lang-name {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: capitalize;
}

.lang-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lang-stat {
  text-align: right;
}

.lang-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.lang-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Progress bar ──────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
  transition: width 0.4s;
}

/* ── Loading spinner ───────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--primary-light);
  border-top-color: var(--primary-mid);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.text-muted { color: var(--text-muted); font-size: 0.85rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state p { font-size: 0.9rem; }

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Tab content spacing ───────────────────────────────────────────────────── */
.section-gap { margin-bottom: 1.25rem; }

/* ── Divider ───────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-header { padding: 0 1rem; }
  .tab-nav-bar { padding: 0 0.75rem; }
  .layout-container { padding: 1rem; }

  .stat-grid { grid-template-columns: 1fr 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .card { padding: 1.25rem; }
  .modal { padding: 1.5rem; }

  .search-bar input { width: 160px; }
  .card-header { flex-direction: column; align-items: flex-start; }
}

/* ── Social Slides (tabblad) ──────────────────────────────────────────────── */

/* btn-random (nieuw in social) */
.btn-random {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: var(--primary-light);
  color: var(--primary-mid);
  border: 1px solid #C4B5FD;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-random svg              { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }
.btn-random:hover:not(:disabled) { background: #DDD6FE; }
.btn-random:disabled         { opacity: 0.5; cursor: not-allowed; }

/* field-label-row */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Sub-navigatie */
.social-sub-nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 2rem;
  display: flex;
}

.social-sub-nav-pills {
  display: flex;
  gap: 0.25rem;
  background: #EAECF4;
  border-radius: 0.75rem;
  padding: 0.25rem;
}

.social-sub-nav-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1rem;
  border-radius: 0.5625rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.social-sub-nav-item:hover        { color: var(--text); }
.social-sub-nav-item.active       { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06); }

.social-tab-panel        { display: none; }
.social-tab-panel.active { display: block; }

/* Content grid */
.social-content-grid {
  display: grid;
  gap: 1.25rem;
  padding: 1.75rem 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .social-content-grid { grid-template-columns: minmax(340px, 500px) 1fr; align-items: start; }
}

.social-form-card form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  margin-top: 1.25rem;
}

/* Platform select met gekleurde dot */
.social-select-wrap { position: relative; display: flex; align-items: center; }
.social-platform-dot {
  position: absolute; left: 0.75rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: #E1306C; pointer-events: none; z-index: 1;
}
.social-select-wrap select { padding-left: 1.875rem !important; }

/* Output card */
.social-output-card  { display: flex; flex-direction: column; }
.social-output-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}

/* Lege state */
.social-output-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 3rem 1.5rem; gap: 0.875rem;
}
.social-empty-icon-circle {
  width: 4rem; height: 4rem; border-radius: 50%;
  background: rgba(124, 58, 237, 0.08);
  display: flex; align-items: center; justify-content: center; margin-bottom: 0.25rem;
}
.social-empty-icon-circle svg { width: 1.75rem; height: 1.75rem; color: var(--primary-mid); }
.social-empty-title    { font-size: 1.0625rem; font-weight: 700; color: var(--text); }
.social-empty-subtitle { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; max-width: 300px; }

/* Resultaat-secties */
.social-result-section-card {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.875rem 1.125rem; margin-bottom: 0.6rem;
}
.social-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.45rem; }
.social-section-content { font-size: 0.9rem; color: var(--text); line-height: 1.72; }
.social-overline {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--primary-mid);
}
.social-section-group { margin-bottom: 0.6rem; }
.social-section-group .social-result-section-card { margin-bottom: 0; }
.social-section-group .social-group-top  { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: none; }
.social-section-group .social-group-bottom { border-top-left-radius: 0; border-top-right-radius: 0; background: var(--surface); border-top: 1px dashed var(--border); }

.social-hashtag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.social-hashtag {
  display: inline-block; padding: 0.2rem 0.65rem;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid #C4B5FD; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600;
}

/* Slide cards */
.social-slide-card {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.875rem 1.125rem;
  margin-bottom: 0.6rem; transition: border-color 0.16s, box-shadow 0.16s;
}
.social-slide-card:hover { border-color: #C4B5FD; box-shadow: var(--shadow-sm); }
.social-slide-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.social-slide-badge {
  display: inline-block; padding: 0.15rem 0.65rem;
  background: var(--primary-light); border: 1px solid #C4B5FD; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary);
}
.social-slide-headline { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.375rem; color: var(--text); }
.social-slide-body     { font-size: 0.875rem; color: var(--text-muted); line-height: 1.75; white-space: pre-line; }
.social-slide-copy-msg { font-size: 0.7rem; margin-top: 0.35rem; font-weight: 600; }

/* History layout */
.social-history-layout { padding: 1.75rem 2rem; max-width: 760px; }
.social-history-card   { display: flex; flex-direction: column; gap: 1rem; }
.social-history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.social-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.65rem; height: 1.65rem; padding: 0 0.45rem;
  background: var(--primary-light); border: 1px solid #C4B5FD; border-radius: 999px;
  color: var(--primary); font-size: 0.75rem; font-weight: 700; margin-top: 0.3rem;
}
.social-history-empty {
  background: var(--surface-alt); border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm); padding: 0.875rem 1.125rem;
  font-size: 0.875rem; font-weight: 500; color: var(--text-dim);
}
.social-history-item {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.8rem 1.1rem 0.8rem 1.25rem;
  cursor: pointer; text-align: left; width: 100%;
  font-family: var(--font); position: relative; overflow: hidden;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.social-history-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary-mid); transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1); border-radius: 0 2px 2px 0;
}
.social-history-item:hover              { background: var(--surface); border-color: #C4B5FD; box-shadow: var(--shadow-sm); }
.social-history-item:hover::before      { transform: scaleY(1); }
.social-history-item .social-meta       { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.3rem; }
.social-history-title                   { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.social-history-description             { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 0.35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.social-history-hashtags                { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.1rem; }
.social-history-hashtags span           { font-size: 0.67rem; font-weight: 600; color: var(--primary); background: var(--primary-light); border: 1px solid #C4B5FD; border-radius: 999px; padding: 0.1rem 0.42rem; }
.social-history-hashtags .social-more   { color: var(--text-dim); background: var(--surface); border-color: var(--border); }

/* Settings layout */
.social-settings-layout { padding: 1.75rem 2rem; display: flex; flex-direction: column; gap: 1.25rem; max-width: 600px; }
.social-settings-card   { display: flex; flex-direction: column; gap: 1rem; }
.social-settings-hint   { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; }
.social-settings-hint code { background: var(--surface-input); padding: 0.1rem 0.4rem; border-radius: 0.3rem; font-size: 0.82em; color: var(--primary); font-weight: 600; }
.social-key-status-row  { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.875rem; background: var(--surface-input); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.social-key-status-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; transition: background 0.2s; }
.social-key-status-dot.is-set  { background: var(--success); }
.social-key-status-dot.not-set { background: var(--error); }
.social-key-input-wrap  { position: relative; display: flex; }
.social-key-input-wrap input { flex: 1; padding-right: 2.8rem !important; }
.social-btn-key-toggle  { position: absolute; right: 0; top: 0; bottom: 0; width: 2.75rem; background: transparent; border: none; border-left: 1px solid var(--border); color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.15s; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.social-btn-key-toggle:hover { color: var(--primary-mid); }
.social-btn-key-toggle svg   { width: 1rem; height: 1rem; }
.social-settings-save-btn { align-self: flex-start; width: auto; padding: 0.65rem 1.5rem; }
.social-settings-msg      { font-size: 0.82rem; font-weight: 600; }
.social-settings-field    { max-width: 440px; }
.social-toggle-row        { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.9rem; color: var(--text); cursor: pointer; max-width: 440px; }
.social-toggle-row input[type="checkbox"] { width: 2.4rem; height: 1.3rem; appearance: none; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.social-toggle-row input[type="checkbox"]::after { content: ''; position: absolute; top: 0.175rem; left: 0.175rem; width: 0.95rem; height: 0.95rem; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.social-toggle-row input[type="checkbox"]:checked { background: var(--primary-mid); }
.social-toggle-row input[type="checkbox"]:checked::after { transform: translateX(1.1rem); }
.social-model-badge-row { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 500; color: var(--text-dim); }
.social-model-badge-row svg { width: 0.875rem; height: 0.875rem; }

/* Output actions row */
.social-output-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.social-slide-builder-btn { display: flex; align-items: center; gap: 0.45rem; padding: 0.55rem 1rem; font-size: 0.825rem; white-space: nowrap; }
.social-slide-builder-btn svg { flex-shrink: 0; }

/* ── Slide Builder Modal ───────────────────────── */
.slide-builder-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1.5rem; overflow-y: auto;
}
.slide-builder-modal {
  background: var(--surface); border-radius: 16px;
  width: 100%; max-width: 920px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
  margin: auto;
}
.slide-builder-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.125rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.slide-builder-header h3 { font-size: 1.0625rem; font-weight: 700; color: var(--text); margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.sbuilder-lang-badge {
  display: inline-block; padding: 0.15rem 0.65rem;
  background: var(--primary-light); border: 1px solid #C4B5FD; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary);
}
.slide-builder-close {
  background: none; border: none; font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: var(--text-muted); padding: 0 0.25rem; transition: color 0.15s;
}
.slide-builder-close:hover { color: var(--text); }
.slide-builder-body {
  padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem;
  overflow-y: auto; max-height: 72vh;
}
.sbuilder-row {
  display: grid; grid-template-columns: 1fr 1fr 108px;
  gap: 1rem; align-items: start;
  padding: 1rem 1.125rem; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.sbuilder-badge {
  display: inline-block; padding: 0.15rem 0.65rem;
  background: var(--primary-light); border: 1px solid #C4B5FD; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 0.5rem;
}
.sbuilder-headline { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; line-height: 1.45; }
.sbuilder-body-text { font-size: 0.825rem; color: var(--text-muted); line-height: 1.7; white-space: pre-line; }
.sbuilder-picker-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.5rem;
}
.sbuilder-img-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem;
  max-height: 220px; overflow-y: auto;
}
.sbuilder-thumb {
  aspect-ratio: 9/16; border-radius: 6px; cursor: pointer;
  border: 2.5px solid transparent; transition: border-color 0.15s, transform 0.12s;
  background: var(--border) center/cover no-repeat;
}
.sbuilder-thumb:hover { transform: scale(1.04); }
.sbuilder-thumb.is-selected { border-color: var(--primary-mid); box-shadow: 0 0 0 2px rgba(139,92,246,0.18); }
.sbuilder-canvas-col { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.sbuilder-canvas-wrap {
  width: 100%; aspect-ratio: 9/16; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-input);
  display: flex; align-items: center; justify-content: center;
}
.sbuilder-canvas-wrap canvas { width: 100%; height: 100%; display: block; object-fit: contain; }
.sbuilder-canvas-placeholder { font-size: 0.65rem; color: var(--text-dim); text-align: center; padding: 0.5rem; }
.sbuilder-dl-slide-btn {
  width: 100%; font-size: 0.7rem; font-weight: 600; padding: 0.3rem 0.4rem;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid #C4B5FD; border-radius: 6px; cursor: pointer;
  transition: background 0.15s; text-align: center;
}
.sbuilder-dl-slide-btn:hover { background: #DDD6FE; }
.sbuilder-dl-slide-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.sbuilder-empty-images { font-size: 0.82rem; color: var(--text-dim); padding: 0.5rem 0; }
.slide-builder-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border); flex-shrink: 0;
}
.slide-builder-footer-note { font-size: 0.78rem; color: var(--text-dim); }
.sbuilder-dl-all-btn { display: flex; align-items: center; gap: 0.45rem; }
.sbuilder-dl-all-btn svg { flex-shrink: 0; }

/* Gemini debug popup */
.gemini-debug-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.gemini-debug-modal   { background: var(--surface); border-radius: 12px; width: 100%; max-width: 680px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.25); overflow: hidden; }
.gemini-debug-header  { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.9rem; color: var(--text); flex-shrink: 0; }
.gemini-debug-close   { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 0 0.25rem; }
.gemini-debug-close:hover { color: var(--text); }
.gemini-debug-body    { overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.gemini-debug-body section h3 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }
.gemini-debug-body pre { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; padding: 0.875rem 1rem; font-size: 0.78rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--text); font-family: ui-monospace, monospace; }

/* Mobile */
@media (max-width: 640px) {
  .social-sub-nav-bar  { padding: 0.5rem 1rem; }
  .social-sub-nav-pills { width: 100%; }
  .social-sub-nav-item  { flex: 1; justify-content: center; padding: 0.4rem 0.5rem; }
  .social-content-grid, .social-history-layout, .social-settings-layout { padding: 1rem; }
}

/* ── Blog tab ──────────────────────────────────────────────────────────────── */
.blog-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.blog-editor-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .blog-editor-grid { grid-template-columns: 1fr; }
}

.blog-side-heading {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .875rem;
}

.blog-status-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.blog-status-opt { flex: 1; cursor: pointer; }
.blog-status-opt input { display: none; }

.blog-status-opt span {
  display: block;
  text-align: center;
  padding: .55rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

.blog-status-opt input:checked + span {
  background: var(--primary-mid);
  color: #fff;
}

.blog-badge-published {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--success-light);
  color: var(--success);
}

.blog-badge-concept {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.blog-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .15rem .45rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.4;
}
.blog-lang-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.blog-lang-btn.used { background: #ede9f7; border-color: var(--primary); color: var(--primary); }
.blog-lang-btn:disabled { opacity: .5; cursor: default; }

/* Quill snow overrides — light theme */
.ql-toolbar.ql-snow {
  border: 1.5px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface-alt);
  font-family: var(--font);
}

.ql-container.ql-snow {
  border: 1.5px solid var(--border) !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: var(--font);
  font-size: .9rem;
}

.ql-editor {
  min-height: 110px;
  color: var(--text);
}

.blog-content-editor .ql-editor { min-height: 300px; }

/* ── Media module ───────────────────────────────────────────────────────────── */
.media-lang-group { margin-bottom: 1.5rem; }

.media-lang-heading {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .75rem;
}

/* Card = thumbnail only, no body */
.media-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 9 / 16;
  background: #111;
  background-size: cover;
  background-position: center;
  transition: box-shadow .15s;
}

.media-card:hover { box-shadow: 0 0 0 2px var(--primary-mid); }

/* Download counter — always visible, bottom-left */
.media-count-badge {
  position: absolute;
  bottom: 6px;
  left: 8px;
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  pointer-events: none;
  z-index: 1;
}

/* Overlay — hidden by default, shown on .active */
.media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: .4rem;
  padding: .75rem .6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 2;
}

.media-card.active .media-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Overlay buttons */
.media-overlay a,
.media-overlay button {
  font-size: .75rem;
  font-family: var(--font);
  font-weight: 600;
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  border: none;
  transition: background .12s, color .12s;
}

.media-btn-download {
  background: var(--primary-mid);
  color: #fff;
}
.media-btn-download:hover { background: var(--primary); color: #fff; }

.media-btn-reset {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3) !important;
}
.media-btn-reset:hover { background: rgba(255,255,255,.28); }

.media-btn-delete {
  background: rgba(220,38,38,.25);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,.4) !important;
}
.media-btn-delete:hover { background: rgba(220,38,38,.45); color: #fff; }

/* Uploading skeleton card */
.media-card-uploading {
  position: relative;
  border-radius: var(--radius-sm);
  aspect-ratio: 9 / 16;
  background: var(--surface-alt);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-card-uploading .spinner {
  width: 20px; height: 20px;
  border-width: 2px;
}

.media-filter-pill {
  padding: .3rem .85rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}

.media-filter-pill:hover {
  border-color: var(--primary-mid);
  color: var(--primary-mid);
}

.media-filter-pill.active {
  background: var(--primary-mid);
  border-color: var(--primary-mid);
  color: #fff;
}
