/* RedactieHub — app.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* ── App shell ── */
.app-shell { display: flex; min-height: 100vh; }
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-content { flex: 1; padding: 24px; overflow-y: auto; }

/* ── Sidebar ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
}
.sidebar__logo { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar__brand { color: #fff; font-size: 18px; font-weight: 700; text-decoration: none; }
.nav { padding: 12px 0; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none; font-size: 13px;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.nav__item:hover, .nav__item--active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-left-color: var(--accent);
}
.nav__icon { width: 20px; text-align: center; font-size: 16px; }

/* ── Topbar ── */
.topbar {
  height: 56px; background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 12px; flex-shrink: 0;
}
.topbar__search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 6px;
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  min-width: 220px;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__theme-btn { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px 8px; }

/* ── Notificatiebel ── */
.notif-bell { position: relative; }
.notif-bell__btn { background: none; border: none; font-size: 20px; cursor: pointer; position: relative; padding: 4px 8px; }
.notif-bell__badge {
  position: absolute; top: 0; right: 0;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 340px; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 100;
}
.notif-dropdown__header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-dropdown__list { max-height: 320px; overflow-y: auto; }
.notif-dropdown__item { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.notif-dropdown__item--unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif-dropdown__link { display: block; text-decoration: none; color: var(--text-primary); }
.notif-dropdown__time { font-size: 11px; color: var(--text-muted); }
.notif-dropdown__all { display: block; text-align: center; padding: 10px; color: var(--accent); text-decoration: none; font-size: 13px; }
.notif-dropdown__empty { padding: 24px; text-align: center; color: var(--text-muted); }

/* ── User menu ── */
.user-menu { position: relative; }
.user-menu__btn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.user-menu__btn:hover { background: var(--bg-primary); }
.user-menu__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-menu__initials { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.user-menu__name { font-size: 13px; color: var(--text-primary); }
.user-menu__dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 180px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 100; }
.user-menu__item { display: block; padding: 10px 16px; text-decoration: none; color: var(--text-primary); font-size: 13px; background: none; border: none; width: 100%; text-align: left; cursor: pointer; }
.user-menu__item:hover { background: var(--bg-primary); }
.user-menu__item--logout { color: #dc2626; }

/* ── Cards ── */
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; }
.card__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card__title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card__body { padding: 20px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: background 0.15s, opacity 0.15s; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn--ghost:hover { background: var(--bg-primary); }
.btn--danger { background: #dc2626; color: #fff; }
.btn--danger:hover { background: #b91c1c; }
.btn--success { background: #16a34a; color: #fff; }
.btn--link { background: none; border: none; color: var(--accent); padding: 0; cursor: pointer; }
.btn--full { width: 100%; justify-content: center; }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--xs { padding: 3px 7px; font-size: 11px; }

/* ── Forms ── */
.form__group { margin-bottom: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.form__input, .form__select, .form__textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface); color: var(--text-primary); font-size: 14px; transition: border-color 0.15s; }
.form__input:focus, .form__select:focus, .form__textarea:focus { outline: none; border-color: var(--accent); }
.form__input--sm, .form__select--sm { padding: 6px 10px; font-size: 13px; }
.form__input--lg { font-size: 18px; font-weight: 600; }
.form__textarea { resize: vertical; min-height: 80px; }
.form__checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.form__hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form__section-title { font-size: 14px; font-weight: 600; margin: 16px 0 12px; }
.form__inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form__group--center { display: flex; align-items: center; }
.form__group--avatar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.form__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.form--inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { font-weight: 600; color: var(--text-muted); background: var(--bg-primary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.table tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.table__link { color: var(--text-primary); text-decoration: none; font-weight: 500; }
.table__link:hover { color: var(--accent); }
.table__actions { display: flex; gap: 6px; align-items: center; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.badge--concept { background: #fef3c7; color: #92400e; }
.badge--review { background: #dbeafe; color: #1e40af; }
.badge--goedgekeurd { background: #dcfce7; color: #166534; }
.badge--gepubliceerd { background: #d1fae5; color: #065f46; }
.badge--gearchiveerd { background: #f3f4f6; color: #6b7280; }
.badge--open { background: #fee2e2; color: #991b1b; }
.badge--in-behandeling { background: #fef3c7; color: #92400e; }
.badge--gesloten { background: #f3f4f6; color: #6b7280; }
.badge--prio-urgent { background: #fca5a5; color: #7f1d1d; }
.badge--prio-hoog { background: #fed7aa; color: #7c2d12; }
.badge--prio-normaal { background: #e0f2fe; color: #075985; }
.badge--prio-laag { background: #f3f4f6; color: #6b7280; }
.badge--success { background: #dcfce7; color: #166534; }
.badge--error { background: #fee2e2; color: #991b1b; }
.badge--aangevraagd { background: #fef3c7; color: #92400e; }
.badge--goedgekeurd { background: #dcfce7; color: #166534; }
.badge--geweigerd { background: #fee2e2; color: #991b1b; }
.badge--internal { background: #f3e8ff; color: #7c3aed; }
.badge--role-admin { background: #f3e8ff; color: #6d28d9; }
.badge--role-redacteur { background: #dbeafe; color: #1d4ed8; }
.badge--role-fotograaf { background: #fef9c3; color: #a16207; }
.badge--role-recensent { background: #dcfce7; color: #15803d; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert--success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert--error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert--info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ── Page header ── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-back { font-size: 12px; color: var(--text-muted); text-decoration: none; display: block; margin-bottom: 4px; }
.page-back:hover { color: var(--accent); }
.page-header__actions { display: flex; align-items: center; gap: 8px; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.stat-card--accent { border-color: var(--accent); }
.stat-card__label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.stat-card__value { font-size: 32px; font-weight: 700; color: var(--text-primary); }
.stat-card__sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Dashboard grid ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── List items ── */
.list-items { list-style: none; }
.list-item { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item__title { font-weight: 500; color: var(--text-primary); text-decoration: none; font-size: 13px; }
.list-item__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Activity log ── */
.activity-log { list-style: none; }
.activity-log__item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.activity-log__item:last-child { border-bottom: none; }
.activity-log__avatar, .activity-log__initials { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.activity-log__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.activity-log__initials { background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.activity-log__text { flex: 1; font-size: 13px; color: var(--text-primary); }
.activity-log__time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── Filter bar ── */
.filter-bar { margin-bottom: 16px; }
.filter-bar__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Editor form ── */
.editor-form { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.editor-form__main { min-width: 0; }
.editor-form__sidebar { }
.quill-container { min-height: 400px; border-radius: 0 0 6px 6px; }
.ql-toolbar { border-radius: 6px 6px 0 0; background: var(--bg-primary); }
.ql-container { font-size: 15px; }

/* ── Article/ticket layout ── */
.article-layout, .ticket-layout, .event-detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.article-layout__sidebar, .ticket-layout__sidebar, .event-detail-layout__sidebar { }
.article-body { line-height: 1.7; }
.article-body img { max-width: 100%; border-radius: 6px; }
.status-log { list-style: none; }
.status-log__item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.status-log__meta { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.status-log__comment { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* ── Ticket messages ── */
.ticket-message { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.ticket-message--staff { border-left: 3px solid var(--accent); }
.ticket-message--internal { border-left: 3px solid #7c3aed; background: color-mix(in srgb, #7c3aed 4%, var(--bg-surface)); }
.ticket-message__header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ticket-message__body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }

/* ── Media grid ── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.media-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; transition: box-shadow 0.15s; }
.media-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.media-card__thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; }
.media-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-card__icon { font-size: 40px; }
.media-card__info { padding: 8px; }
.media-card__name { display: block; font-size: 11px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card__type { font-size: 10px; color: var(--text-muted); }
.media-card__actions { display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--border); background: var(--bg-primary); }
.media-card--picker .media-card__actions { display: none; }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.lightbox__content { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox__content img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.lightbox__close { position: absolute; top: -12px; right: -12px; background: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 16px; cursor: pointer; }
.lightbox__caption { color: #fff; text-align: center; margin-top: 8px; font-size: 13px; }

/* ── Calendar ── */
#calendar { background: var(--bg-surface); border-radius: 10px; padding: 16px; border: 1px solid var(--border); }
.calendar-toolbar { margin-bottom: 16px; }

/* ── Events ── */
.events-grid { display: flex; flex-direction: column; gap: 12px; }
.event-card { display: flex; align-items: center; gap: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.event-card__date { text-align: center; min-width: 48px; }
.event-card__day { display: block; font-size: 24px; font-weight: 700; color: var(--accent); line-height: 1; }
.event-card__month { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.event-card__info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.event-card__title { font-weight: 600; color: var(--text-primary); text-decoration: none; font-size: 14px; }
.event-card__title:hover { color: var(--accent); }
.event-card__meta { font-size: 12px; color: var(--text-muted); }

/* ── Notifications ── */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item { display: flex; align-items: center; gap: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.notif-item--unread { border-left: 3px solid var(--accent); }
.notif-item__content { flex: 1; }
.notif-item__title { display: block; font-weight: 600; font-size: 13px; }
.notif-item__message { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item__time { font-size: 11px; color: var(--text-muted); }

/* ── Meta list ── */
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.meta-list dt { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.meta-list dd { color: var(--text-primary); }

/* ── Modals ── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal__box { position: relative; background: var(--bg-surface); border-radius: 10px; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,.2); }
.modal__header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal__close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal__body { padding: 20px; }
.modal__footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.tab { padding: 10px 16px; text-decoration: none; color: var(--text-muted); font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab--active, .tab:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Pagination ── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 24px; }
.pagination__item { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text-primary); font-size: 13px; }
.pagination__item--active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Search modal ── */
.search-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.search-modal__box { position: relative; background: var(--bg-surface); border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 16px 48px rgba(0,0,0,.2); overflow: hidden; }
.search-modal__input { width: 100%; padding: 16px 20px; border: none; border-bottom: 1px solid var(--border); font-size: 16px; background: transparent; color: var(--text-primary); outline: none; }
.search-modal__results { max-height: 400px; overflow-y: auto; }
.search-group { padding: 8px 0; }
.search-group__label { padding: 6px 16px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); }
.search-result-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; text-decoration: none; color: var(--text-primary); font-size: 13px; }
.search-result-item:hover { background: var(--bg-primary); }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); }

/* ── Auth pages ── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-primary); }
.auth-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px; width: 100%; max-width: 420px; }
.auth-card__logo { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 24px; }
.auth-card__title { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text-primary); }
.auth-card__link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-card__link a { color: var(--accent); text-decoration: none; }

/* ── Error pages ── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-card { text-align: center; }
.error-card__code { font-size: 80px; font-weight: 700; color: var(--accent); }
.error-card__msg { font-size: 18px; color: var(--text-muted); margin: 12px 0 24px; }

/* ── Profile ── */
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.profile-avatar--placeholder { background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.user-thumb { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-right: 6px; vertical-align: middle; }

/* ── Utilities ── */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-success { color: #16a34a; }
.text-error { color: #dc2626; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
code { font-family: monospace; background: var(--bg-primary); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
