/* ==========================================================================
   TransportMaster — admin.css
   Styles for the admin panel (CMS back-end).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

.admin-body,
.admin-login-body {
  margin: 0;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #1e1e1e;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f5f5f5;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.admin-sidebar {
  width: 240px;
  background: #1a1a1a;
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar__logo {
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.admin-sidebar__logo-link {
  display: block;
  text-decoration: none;
}

.admin-sidebar__logo-text {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.admin-sidebar__logo-sub {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.4);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-sidebar__nav {
  flex: 1;
  padding: 10px 0;
}

.admin-sidebar__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-sidebar__nav-item {
  display: block;
}

.admin-sidebar__nav-link {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 120ms ease, color 120ms ease;
}

.admin-sidebar__nav-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.admin-sidebar__nav-link.is-active {
  background: rgba(183,28,46,.2);
  color: #fff;
  border-left-color: #B71C2E;
  padding-left: 17px;
}

/* --------------------------------------------------------------------------
   Main content area
   -------------------------------------------------------------------------- */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar__title {
  font-size: 17px;
  font-weight: 700;
  color: #1e1e1e;
  margin: 0;
}

.admin-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-logout-form {
  display: inline;
}

.admin-content {
  padding: 24px;
  flex: 1;
}

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */
.admin-login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f2f2f2;
}

.admin-login-wrapper {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.admin-login-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 36px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
}

.admin-login-card__header {
  margin-bottom: 28px;
  text-align: center;
}

.admin-login-card__title {
  font-size: 20px;
  font-weight: 800;
  color: #1e1e1e;
  margin: 0 0 4px;
}

.admin-login-card__subtitle {
  font-size: 13px;
  color: #888;
  margin: 0;
}

.admin-login-form .form-group--submit {
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Alerts / Flash messages
   -------------------------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 4px solid transparent;
}

.alert--success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left-color: #2e7d32;
}

.alert--error {
  background: #fce4e6;
  color: #B71C2E;
  border-left-color: #B71C2E;
}

.alert--warning {
  background: #fff8e1;
  color: #e65100;
  border-left-color: #ffa726;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.admin-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
}

.admin-card:last-child {
  margin-bottom: 0;
}

.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.admin-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #1e1e1e;
  margin: 0;
}

.admin-card__meta {
  font-size: 12px;
  color: #999;
}

.admin-card__description {
  font-size: 13px;
  color: #666;
  margin: 0 0 12px;
}

/* Stat cards — dashboard */
.dashboard__stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-card--stat {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-card--stat-alert {
  border-color: #fcc9cc;
  background: #fff9f9;
}

.admin-card__stat-value {
  font-size: 32px;
  font-weight: 800;
  color: #1e1e1e;
  line-height: 1;
}

.admin-card--stat-alert .admin-card__stat-value {
  color: #B71C2E;
}

.admin-card__stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-card__stat-link {
  font-size: 12px;
  color: #B71C2E;
  text-decoration: none;
  font-weight: 600;
  margin-top: 4px;
}

.admin-card__stat-link:hover {
  text-decoration: underline;
}

/* Upload card */
.admin-card--upload {
  background: #fafafa;
}

/* --------------------------------------------------------------------------
   Media library drop zone
   -------------------------------------------------------------------------- */
.media-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  margin-bottom: 24px;
  border: 2px dashed #d0d7de;
  border-radius: 12px;
  background: #f6f8fa;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  text-align: center;
  outline: none;
  user-select: none;
}
.media-dropzone:hover,
.media-dropzone:focus {
  border-color: #0969da;
  background: #eef5ff;
  box-shadow: 0 0 0 3px rgba(9,105,218,.12);
}
.media-dropzone.is-drag-over {
  border-color: #0969da;
  background: #dceeff;
  box-shadow: 0 0 0 4px rgba(9,105,218,.2);
  transform: scale(1.01);
}

.media-dropzone__icon {
  color: #8c959f;
  transition: color .15s;
}
.media-dropzone:hover .media-dropzone__icon,
.media-dropzone.is-drag-over .media-dropzone__icon {
  color: #0969da;
}

.media-dropzone__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1c2128;
}

.media-dropzone__sub {
  margin: 0;
  font-size: 13px;
  color: #57606a;
}

.media-dropzone__browse {
  color: #0969da;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.media-dropzone__hint {
  margin: 0;
  font-size: 12px;
  color: #8c959f;
}

.media-dropzone__progress {
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
}

.media-dropzone__progress-bar-track {
  height: 6px;
  background: #e1e4e8;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.media-dropzone__progress-bar {
  height: 6px;
  background: #0969da;
  border-radius: 99px;
  width: 0%;
  transition: width .3s ease;
}

.media-dropzone__progress-label {
  font-size: 12px;
  color: #57606a;
  display: block;
  text-align: center;
  margin-top: 6px;
}

/* Flash highlight for newly inserted media cards */
.media-grid__item--new {
  animation: media-card-in .5s ease forwards;
}
@keyframes media-card-in {
  from { box-shadow: 0 0 0 3px #0969da; background: #eef5ff; }
  to   { box-shadow: none; background: #fafafa; }
}

/* --------------------------------------------------------------------------
   Dashboard sections
   -------------------------------------------------------------------------- */
.dashboard__section {
  margin-bottom: 24px;
}

.dashboard__section:last-child {
  margin-bottom: 0;
}

.dashboard__quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Dashboard — Client project cards
   -------------------------------------------------------------------------- */
.dashboard__client-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 4px 0 2px;
}

.dash-cp-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .15s;
}
.dash-cp-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.dash-cp-card--alert {
  border-color: #fca5a5;
  background: #fff8f8;
}

.dash-cp-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f3f4f6;
}
.dash-cp-card--alert .dash-cp-card__head {
  border-bottom-color: #fde8e8;
}
.dash-cp-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-cp-card__company {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cp-card__name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-cp-card__body {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Last message */
.dash-cp-card__msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.dash-cp-card__msg-author {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dash-cp-card__msg-role {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
}
.dash-cp-card__msg-time {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}
.dash-cp-card__msg-body {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dash-cp-card__no-msg {
  font-size: 12px;
  color: #d1d5db;
  margin: 0;
  font-style: italic;
}

/* Counters row */
.dash-cp-card__counters {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.dash-cp-card__counter {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
}
.dash-cp-card__counter svg {
  flex-shrink: 0;
  opacity: .7;
}
.dash-cp-card__counter--alert {
  color: #b91c1c;
}
.dash-cp-card__counter--alert svg {
  opacity: 1;
}
.dash-cp-card__overdue {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.dash-cp-card__new-files {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.dash-cp-card__foot {
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
}
.dash-cp-card--alert .dash-cp-card__foot {
  border-top-color: #fde8e8;
}

/* --------------------------------------------------------------------------
   Toolbar (above table)
   -------------------------------------------------------------------------- */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  text-align: left;
  padding: 9px 12px;
  background: #f8f8f8;
  border-bottom: 2px solid #e0e0e0;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  color: #333;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: #fafafa;
}

.admin-table__row--highlight td {
  background: #fff8f0;
}

.admin-table__actions {
  white-space: nowrap;
}

.admin-table__actions form,
.admin-table__actions .admin-inline-form {
  display: inline;
}

.admin-table__nowrap {
  white-space: nowrap;
}

.admin-table__none {
  padding: 24px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}

.admin-table--nav td,
.admin-table--nav th {
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.admin-form {
  /* container — no special style needed */
}

.admin-inline-form {
  display: inline;
}

.admin-upload-form .form-actions {
  margin-top: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group--inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group--narrow {
  max-width: 320px;
}

.form-group--submit {
  margin-top: 8px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.form-label--checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.form-required {
  color: #B71C2E;
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  color: #1e1e1e;
  background: #fff;
  transition: border-color 120ms ease, outline 120ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: #B71C2E;
  outline: 2px solid rgba(183,28,46,.15);
  outline-offset: 0;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}

.form-input--narrow {
  width: auto;
  min-width: 120px;
}

.form-input--sm {
  padding: 5px 9px;
  font-size: 13px;
}

.form-input--code {
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.form-input--file {
  padding: 6px 8px;
  background: #fafafa;
  cursor: pointer;
}

input[type="checkbox"].form-input,
input[type="radio"].form-input {
  width: 16px;
  height: 16px;
  padding: 0;
  cursor: pointer;
  accent-color: #B71C2E;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  line-height: 1.4;
}

.form-char-counter {
  display: block;
  font-size: 11px;
  color: #aaa;
  text-align: right;
  margin-top: 3px;
}

.form-char-counter.over {
  color: #B71C2E;
  font-weight: 600;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  margin-top: 8px;
}

.form-fieldset {
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 16px 20px;
  margin: 0 0 18px;
}

.form-legend {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  padding: 0 6px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  line-height: 1.3;
  white-space: nowrap;
  font-family: inherit;
  vertical-align: middle;
}

.btn-admin:focus-visible {
  outline: 2px solid #0056B3;
  outline-offset: 2px;
}

.btn-admin--primary {
  background: #B71C2E;
  color: #fff;
  border-color: #B71C2E;
}

.btn-admin--primary:hover {
  background: #8E1523;
  border-color: #8E1523;
  color: #fff;
}

.btn-admin--ghost {
  background: transparent;
  color: #444;
  border-color: #d0d0d0;
}

.btn-admin--ghost:hover {
  background: #f0f0f0;
  color: #1e1e1e;
  border-color: #b8b8b8;
}

.btn-admin--danger {
  background: #fce4e6;
  color: #B71C2E;
  border-color: #fcc9cc;
}

.btn-admin--danger:hover {
  background: #fcc9cc;
  color: #8E1523;
}

.btn-admin--sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-admin--full {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--success  { background: #e8f5e9; color: #2e7d32; }
.badge--danger   { background: #fce4e6; color: #B71C2E; }
.badge--warning  { background: #fff3e0; color: #e65100; }
.badge--neutral  { background: #f0f0f0; color: #666;    }
.badge--blue     { background: #e3f2fd; color: #1565c0; }
.badge--dark     { background: #2e2e2e; color: #fff;    }

.badge--lg {
  padding: 4px 12px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.admin-empty {
  color: #aaa;
  font-size: 14px;
  padding: 12px 0;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Detail list (inquiry show page)
   -------------------------------------------------------------------------- */
.admin-detail-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
}

.admin-detail-list__row {
  display: contents;
}

.admin-detail-list__row--full {
  display: block;
  grid-column: 1 / -1;
}

.admin-detail-list__term,
.admin-detail-list__value {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13.5px;
}

.admin-detail-list__row:last-child .admin-detail-list__term,
.admin-detail-list__row:last-child .admin-detail-list__value,
.admin-detail-list__row--full:last-child {
  border-bottom: none;
}

.admin-detail-list__term {
  font-weight: 600;
  color: #555;
  background: #fafafa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-detail-list__value {
  color: #1e1e1e;
  word-break: break-word;
}

.admin-detail-list__value--message {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Inquiry actions
   -------------------------------------------------------------------------- */
.admin-inquiry-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Media library grid
   -------------------------------------------------------------------------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.media-grid__item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .18s, border-color .18s;
}

.media-grid__item:hover {
  border-color: #c5c5c5;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* Thumbnail + hover overlay */
.media-grid__thumb {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-grid__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.media-grid__item:hover .media-grid__thumb img {
  transform: scale(1.04);
}

.media-grid__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, .52);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity .18s ease;
}

.media-grid__item:hover .media-grid__overlay,
.media-grid__item:focus-within .media-grid__overlay {
  opacity: 1;
}

.media-grid__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  border: none;
  cursor: pointer;
  color: #1a1a2e;
  text-decoration: none;
  transition: background .15s, transform .15s, color .15s;
  flex-shrink: 0;
}

.media-grid__action-btn:hover {
  background: #fff;
  transform: scale(1.12);
}

.media-grid__action-btn--danger:hover {
  color: #B71C2E;
}

/* Info strip */
.media-grid__info {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.media-grid__filename {
  font-size: 12px;
  color: #222;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-grid__meta {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Media picker (inline in forms) */
.media-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-picker-preview {
  margin-top: 8px;
}

.media-picker-preview img {
  max-width: 200px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  display: block;
}

/* --------------------------------------------------------------------------
   Media preview wrap (image picker with inline preview + controls)
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Inline image picker field  (.media-preview-wrap)
   -------------------------------------------------------------------------- */
.media-preview-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 2px dashed #d0d7de;
  border-radius: 10px;
  background: #f6f8fa;
  width: 100%;
  max-width: 400px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  cursor: default;
}

/* When an image is selected */
.media-preview-wrap.has-image {
  border-style: solid;
  border-color: #d0d7de;
  background: #fff;
}

/* Drag-over highlight */
.media-preview-wrap.is-drag-over {
  border-color: #0969da;
  background: #dceeff;
  box-shadow: 0 0 0 4px rgba(9,105,218,.18);
}
.media-preview-wrap.is-drag-over::after {
  content: 'Laat los om te uploaden';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9,105,218,.1);
  color: #0969da;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  pointer-events: none;
  letter-spacing: .01em;
}

/* Uploading overlay */
.media-preview-wrap.is-uploading {
  pointer-events: none;
}
.media-preview-wrap.is-uploading::after {
  content: 'Uploaden...';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.8);
  color: #0969da;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  pointer-events: none;
}

/* Preview image */
.media-preview-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e4e7ec;
  background: #f0f2f5;
  display: block;
}

/* Drop hint injected by JS for empty fields */
.media-drop-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 6px;
  padding: 12px 0;
  color: #8c959f;
  text-align: center;
  pointer-events: none;
}
.media-drop-hint svg { color: #b3bac3; }
.media-drop-hint span { font-size: 13px; font-weight: 500; color: #57606a; }
.media-drop-hint__sub { font-size: 11px !important; font-weight: 400 !important; color: #9aa3ad !important; }

/* Hide drop hint once image is selected */
.media-preview-wrap.has-image .media-drop-hint { display: none; }

/* Controls row */
.media-preview-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

/* Hide "Verwijderen" when no image */
.media-preview-wrap:not(.has-image) .media-preview-clear { display: none; }

/* Drag-over on the media picker modal body */
.mpm-body.is-drag-over {
  outline: 3px dashed #0969da;
  outline-offset: -10px;
  background: #dceeff;
}

/* --------------------------------------------------------------------------
   Media picker modal (mpm-*)
   -------------------------------------------------------------------------- */
#media-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mpm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, .6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mpm-dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 1100px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(13,27,42,.35);
  overflow: hidden;
}

/* Header */
.mpm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  background: #fff;
  gap: 16px;
  flex-shrink: 0;
}

.mpm-header__left { display: flex; align-items: center; gap: 12px; }
.mpm-header__right { display: flex; align-items: center; gap: 10px; }

.mpm-title {
  font-size: 15px;
  font-weight: 700;
  color: #0d1b2a;
  margin: 0;
  white-space: nowrap;
}

.mpm-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mpm-search-icon {
  position: absolute;
  left: 10px;
  color: #9aa3ad;
  pointer-events: none;
}

.mpm-search {
  width: 260px;
  padding: 7px 12px 7px 32px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: #f6f8fa;
  color: #1c2128;
  transition: border-color .15s, box-shadow .15s;
}
.mpm-search:focus {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,.12);
  background: #fff;
}

.mpm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: #6e7781;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.mpm-close:hover { background: #f0f2f5; color: #1c2128; }

/* Body / grid */
.mpm-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f6f8fa;
}

.mpm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* Individual item */
.mpm-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #e1e4e8;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  font-family: inherit;
}
.mpm-item:hover {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,.12);
  transform: translateY(-2px);
}

.mpm-item__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 5px;
  background: #f0f2f5;
}

.mpm-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mpm-item__check {
  position: absolute;
  inset: 0;
  background: rgba(9,105,218,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .12s;
  border-radius: 5px;
}
.mpm-item:hover .mpm-item__check { opacity: 1; }

.mpm-item__name {
  font-size: 11px;
  color: #57606a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px 2px;
  line-height: 1.3;
}

/* Loading state */
.mpm-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #6e7781;
  font-size: 13px;
  grid-column: 1 / -1;
}

.mpm-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e1e4e8;
  border-top-color: #0969da;
  border-radius: 50%;
  animation: mpm-spin .7s linear infinite;
}
@keyframes mpm-spin { to { transform: rotate(360deg); } }

/* Empty state */
.mpm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 60px 20px;
  color: #6e7781;
  font-size: 13px;
  text-align: center;
  grid-column: 1 / -1;
}
.mpm-empty p { margin: 0; }

/* Footer */
.mpm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #e9ecef;
  background: #fff;
  flex-shrink: 0;
  gap: 12px;
}

.mpm-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.mpm-footer__hint {
  font-size: 12px;
  color: #9aa3ad;
}

/* --------------------------------------------------------------------------
   Block editor (page blocks)
   -------------------------------------------------------------------------- */
.block-editor {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.block-editor-empty {
  padding: 32px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

.block-item {
  border-bottom: 1px solid #f0f0f0;
}

.block-item:last-child { border-bottom: none; }

.block-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fafafa;
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease;
}

.block-item-header:hover { background: #f4f4f4; }

.block-item-handle {
  cursor: grab;
  color: #bbb;
  font-size: 16px;
  padding: 4px 2px;
}

.block-item-handle:active { cursor: grabbing; }

.block-item-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #666;
  background: #e8e8e8;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.block-item-label {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.block-item-toggle {
  font-size: 12px;
  color: #aaa;
  min-width: 16px;
  text-align: center;
}

.block-item-body {
  padding: 16px;
  display: none;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.block-item.is-open .block-item-body { display: block; }

.block-add-bar {
  padding: 12px 16px;
  background: #f8f8f8;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.block-add-bar span {
  font-size: 11px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* --------------------------------------------------------------------------
   SEO preview
   -------------------------------------------------------------------------- */
.seo-preview {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  font-family: Arial, sans-serif;
}

.seo-preview-title {
  font-size: 18px;
  color: #1a0dab;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seo-preview-url {
  font-size: 13px;
  color: #006621;
  margin-bottom: 4px;
}

.seo-preview-desc {
  font-size: 13px;
  color: #545454;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 13px;
  color: #888;
}

.admin-pagination-pages {
  display: flex;
  gap: 4px;
  align-items: center;
}

.admin-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  cursor: pointer;
  transition: all 120ms ease;
}

.admin-page-btn:hover  { border-color: #B71C2E; color: #B71C2E; }
.admin-page-btn.active { background: #B71C2E; border-color: #B71C2E; color: #fff; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.admin-divider {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 16px 0;
}

.admin-text-muted {
  color: #999;
  font-size: 13px;
}

.admin-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── List controls (search + per-page) ───────────────────────────────────── */

.admin-list-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-search-form {
  flex: 1 1 260px;
  min-width: 200px;
}

.admin-search-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-search-input {
  flex: 1;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--admin-border, #d0d5dd);
  border-radius: 6px;
  background: #fff;
  color: var(--admin-text, #1a1a2e);
  min-width: 0;
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--clr-crimson, #B71C2E);
  box-shadow: 0 0 0 3px rgba(183,28,46,.12);
}

.admin-list-controls__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.admin-list-controls__count {
  font-size: 13px;
  color: var(--admin-text-muted, #667085);
  white-space: nowrap;
}

.admin-perpage-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-perpage-label {
  font-size: 13px;
  color: var(--admin-text-muted, #667085);
  white-space: nowrap;
}

.admin-perpage-select {
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--admin-border, #d0d5dd);
  border-radius: 6px;
  background: #fff;
  color: var(--admin-text, #1a1a2e);
  cursor: pointer;
}

/* ── Sortable column headers ─────────────────────────────────────────────── */

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

.sort-link:hover {
  color: var(--clr-crimson, #B71C2E);
}

.sort-link--active {
  color: var(--clr-crimson, #B71C2E);
}

.sort-icon {
  font-size: 11px;
  opacity: 0.5;
  line-height: 1;
}

.sort-link--active .sort-icon {
  opacity: 1;
}

/* ── Pagination (admin) ──────────────────────────────────────────────────── */

.admin-card .pagination {
  padding: 16px 0 4px;
  border-top: 1px solid var(--admin-border, #e5e7eb);
  margin-top: 8px;
}

.admin-card .pagination__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.admin-card .pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--admin-border, #d0d5dd);
  border-radius: 6px;
  color: var(--admin-text, #1a1a2e);
  text-decoration: none;
  background: #fff;
  transition: border-color .15s, background .15s, color .15s;
}

.admin-card .pagination__link:hover {
  border-color: var(--clr-crimson, #B71C2E);
  color: var(--clr-crimson, #B71C2E);
}

.admin-card .pagination__item--active .pagination__link {
  background: var(--clr-crimson, #B71C2E);
  border-color: var(--clr-crimson, #B71C2E);
  color: #fff;
  font-weight: 600;
}

.admin-card .pagination__item--disabled .pagination__link {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


/* ==========================================================================
   RICH TEXT EDITOR  (rich-editor.js)
   ========================================================================== */

/* --- Wrapper --- */
.re-wrap {
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* --- Toolbar --- */
.re-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #f8f9fa;
  border-bottom: 1px solid #d0d5dd;
  user-select: none;
}

.re-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #d0d5dd;
  margin: 0 4px;
  flex-shrink: 0;
}

/* --- Toolbar buttons --- */
.re-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  line-height: 1;
  transition: background 110ms, border-color 110ms, color 110ms;
}
.re-btn:hover {
  background: #e9ecef;
  border-color: #cdd3da;
}
.re-btn.is-active {
  background: #B71C2E;
  color: #fff;
  border-color: #a3192a;
}
.re-btn.is-active:hover {
  background: #9b1728;
}
.re-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Block format buttons (P, H2, H3, H4) */
.re-btn--block {
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.re-btn--blockquote { font-size: 14px; }

/* --- Editable body --- */
.re-body {
  min-height: 260px;
  max-height: 600px;
  overflow-y: auto;
  padding: 16px 20px;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.7;
  color: #1e1e1e;
  outline: none;
  word-break: break-word;
}

/* Content styling inside the editor */
.re-body p          { margin: 0 0 .9em; }
.re-body h2         { font-size: 1.45em; font-weight: 700; margin: 1.2em 0 .5em; }
.re-body h3         { font-size: 1.2em;  font-weight: 700; margin: 1.1em 0 .45em; }
.re-body h4         { font-size: 1.05em; font-weight: 700; margin: 1em 0 .4em; }
.re-body blockquote {
  margin: 1em 0;
  padding: .6em 1.2em;
  border-left: 4px solid #B71C2E;
  color: #555;
  background: #fdf4f5;
  border-radius: 0 4px 4px 0;
  font-style: italic;
}
.re-body ul, .re-body ol { margin: 0 0 .9em 1.4em; padding: 0; }
.re-body li { margin-bottom: .25em; }
.re-body a  { color: #B71C2E; text-decoration: underline; }
.re-body hr { border: none; border-top: 2px solid #e5e7eb; margin: 1.4em 0; }
.re-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
.re-body td, .re-body th {
  border: 1px solid #d0d5dd;
  padding: 6px 10px;
  vertical-align: top;
}
.re-body th { background: #f8f9fa; font-weight: 600; }

/* Figures / images inside editor */
.re-body figure {
  margin: 1.2em 0;
  display: block;
}
.re-body figure img {
  display: block;
  border-radius: 4px;
  max-width: 100%;
  height: auto;
}
.re-body figcaption {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
  font-style: italic;
  text-align: center;
}

/* Image alignment classes (editor + frontend) */
.re-body .img-center { margin-left: auto; margin-right: auto; text-align: center; }
.re-body .img-full   { width: 100%; }
.re-body .img-left   { float: left; margin-right: 1.5em; margin-bottom: .5em; }
.re-body .img-right  { float: right; margin-left: 1.5em; margin-bottom: .5em; }
.re-body .img-sm     { max-width: 300px; }
.re-body .img-md     { max-width: 540px; }
.re-body .img-lg     { max-width: 800px; }
.re-body .img-xl     { max-width: 100%; }
.re-body .img-responsive { max-width: 100%; height: auto; }

/* --- Source textarea --- */
.re-source {
  display: none;
  width: 100%;
  min-height: 300px;
  padding: 16px;
  border: none;
  outline: none;
  resize: vertical;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #24292e;
  background: #f6f8fa;
  box-sizing: border-box;
}

/* --- Status bar --- */
.re-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  font-size: 11.5px;
  color: #6b7280;
  gap: 12px;
}
.re-wc  { font-weight: 500; }
.re-hint { opacity: .65; }

/* ==========================================================================
   IMAGE INSERT DIALOG
   ========================================================================== */

#re-img-dlg {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.re-dlg__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.re-dlg__box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.re-dlg__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e9ecef;
}

.re-dlg__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e1e1e;
}

.re-dlg__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: background 110ms, color 110ms;
}
.re-dlg__close:hover { background: #f3f4f6; color: #111; }

.re-dlg__preview {
  padding: 12px 20px 0;
  text-align: center;
}
.re-dlg__preview img {
  max-height: 140px;
  max-width: 100%;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid #e9ecef;
}

.re-dlg__fields {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.re-dlg__field { display: flex; flex-direction: column; gap: 6px; }

.re-dlg__lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
}
.re-dlg__req { color: #B71C2E; }
.re-dlg__opt { font-weight: 400; color: #9ca3af; }

.re-dlg__inp {
  padding: 7px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  font-size: 13.5px;
  font-family: inherit;
  color: #1e1e1e;
  background: #fff;
  transition: border-color 120ms, box-shadow 120ms;
  outline: none;
}
.re-dlg__inp:focus {
  border-color: #B71C2E;
  box-shadow: 0 0 0 3px rgba(183,28,46,.12);
}

/* Alignment grid */
.re-align-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.re-align-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 8px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  color: #374151;
  font-family: inherit;
  transition: border-color 120ms, background 120ms, color 120ms;
  line-height: 1.2;
  text-align: center;
}
.re-align-btn svg { flex-shrink: 0; }
.re-align-btn:hover {
  border-color: #B71C2E;
  background: #fdf4f5;
  color: #B71C2E;
}
.re-align-btn.is-active {
  border-color: #B71C2E;
  background: #B71C2E;
  color: #fff;
}
.re-align-btn.is-active svg { opacity: 1; }

/* Size grid */
.re-size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.re-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 120ms, background 120ms, color 120ms;
  text-align: center;
}
.re-size-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.re-size-px {
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.2;
}
.re-size-btn:hover {
  border-color: #B71C2E;
  background: #fdf4f5;
}
.re-size-btn:hover .re-size-label { color: #B71C2E; }
.re-size-btn.is-active {
  border-color: #B71C2E;
  background: #B71C2E;
}
.re-size-btn.is-active .re-size-label,
.re-size-btn.is-active .re-size-px { color: #fff; }

/* Dialog footer */
.re-dlg__footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 0 0 10px 10px;
}


/* ==========================================================================
   NAVIGATION ADMIN  (navigation/index.php)
   ========================================================================== */

/* ── Card header ────────────────────────────────────────────────────────── */
.nav-card .admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-card__title-wrap svg { opacity: .55; }

/* Empty state */
.nav-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 13.5px;
}
.nav-empty p { margin: 0; line-height: 1.6; }

/* ── Tree ───────────────────────────────────────────────────────────────── */
.nav-tree {
  padding: 8px 0 4px;
}

/* ── Nav Row ────────────────────────────────────────────────────────────── */
.nav-row {
  position: relative;
  border-radius: 6px;
  margin: 3px 10px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  transition: border-color 140ms, box-shadow 140ms, opacity 140ms;
}

.nav-row:hover { border-color: #b5bdc8; }
.nav-row.is-dragging { opacity: .35; border-style: dashed; }

/* ─ Separator drop targets (injected during drag) ─ */
.nav-drop-sep {
  height: 8px;
  margin: -4px 10px;  /* negative margins cancel the height → zero layout shift */
  position: relative;
  z-index: 10;        /* above rows so it intercepts pointer events in the gap */
  pointer-events: all;
}
.nav-drop-sep.is-active::after {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: #B71C2E;
  border-radius: 2px;
  box-shadow: 0 0 0 3px rgba(183,28,46,.15);
}

/* ─ Drop zone indicators ─ */
/* before: line on top  */
.nav-row.drop-before {
  box-shadow: 0 -3px 0 0 #B71C2E;
  border-top-color: #B71C2E;
}
/* after: line on bottom */
.nav-row.drop-after {
  box-shadow: 0 3px 0 0 #B71C2E;
  border-bottom-color: #B71C2E;
}
/* drop success pulse (briefly shown after a successful 'into' drop) */
@keyframes nav-drop-success {
  0%   { background: #fdf4f5; border-color: #B71C2E; box-shadow: 0 0 0 4px rgba(183,28,46,.35); }
  60%  { background: #fdf4f5; border-color: #B71C2E; box-shadow: 0 0 0 4px rgba(183,28,46,.35); }
  100% { background: #fff;    border-color: #e5e7eb; box-shadow: none; }
}
.nav-row.drop-success {
  animation: nav-drop-success 1.2s ease-out forwards;
}

/* into: full highlight + label hint */
.nav-row.drop-into {
  border-color: #B71C2E;
  background: #fdf4f5;
  box-shadow: 0 0 0 3px rgba(183,28,46,.18);
}
.nav-row.drop-into > .nav-row__summary::after {
  content: '↳ submenu';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #B71C2E;
  background: #fdf4f5;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(183,28,46,.3);
  pointer-events: none;
  letter-spacing: .02em;
}

/* Summary line */
.nav-row__summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px 9px 8px;
  cursor: default;
  user-select: none;
  position: relative;
}

/* Drag handle */
.nav-row__drag {
  cursor: grab;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}
.nav-row__drag:hover { background: #f3f4f6; color: #374151; }
.nav-row:active .nav-row__drag { cursor: grabbing; }

/* Expand toggle */
.nav-row__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #6b7280;
  flex-shrink: 0;
  transition: background 110ms, color 110ms;
  padding: 0;
}
.nav-row__toggle:hover { background: #f3f4f6; color: #111; }

.nav-row__caret {
  transition: transform 200ms ease;
}
.nav-row.is-expanded .nav-row__caret {
  transform: rotate(180deg);
}

/* Type badge */
.nav-row__type-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}
.nav-row__type-badge--page { background: #eff6ff; color: #3b82f6; }
.nav-row__type-badge--ext  { background: #fff7ed; color: #f97316; }

/* Label & URL text */
.nav-row__label-text {
  font-weight: 600;
  font-size: 13.5px;
  color: #1e1e1e;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.nav-row__url-text {
  font-size: 12px;
  color: #6b7280;
  font-family: 'Fira Code', 'Consolas', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* Children count pill */
.nav-row__children-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  background: #e5e7eb;
  color: #374151;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Target badge */
.nav-row__target-badge {
  display: flex;
  align-items: center;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Row action buttons */
.nav-row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-admin--xs {
  height: 26px;
  padding: 0 7px;
  font-size: 11px;
  gap: 3px;
}

/* ── Expanded editor ────────────────────────────────────────────────────── */
.nav-row__editor {
  display: none;
  padding: 12px 14px 14px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  border-radius: 0 0 5px 5px;
}
.nav-row.is-expanded .nav-row__editor { display: block; }

.nav-row__editor-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr 160px;
  gap: 12px;
  align-items: start;
}

@media (max-width: 700px) {
  .nav-row__editor-grid { grid-template-columns: 1fr; }
}

.form-group--narrow { min-width: 150px; }

/* URL input + browse button */
.nav-url-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-url-wrap .form-input { flex: 1; }

.nav-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 36px;
  border: 1.5px solid #d0d5dd;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  color: #374151;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 110ms, background 110ms, color 110ms;
}
.nav-browse-btn:hover {
  border-color: #B71C2E;
  background: #fdf4f5;
  color: #B71C2E;
}

/* ── Children container ────────────────────────────────────────────────── */
.nav-children {
  padding: 4px 0 6px 28px;
  position: relative;
}

/* Vertical connecting line */
.nav-children::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 10px;
  width: 2px;
  background: #e5e7eb;
  border-radius: 1px;
}

/* Horizontal connector per child */
.nav-children .nav-row {
  position: relative;
}
.nav-children .nav-row::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  width: 10px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 1px;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Children rows style */
.nav-children .nav-row {
  margin: 3px 8px 3px 0;
  background: #f9fafb;
}
.nav-children .nav-row__label-text { font-weight: 500; }

/* ── Add item form (inline) ─────────────────────────────────────────────── */
.nav-add-form {
  border: 2px dashed #d0d5dd;
  border-radius: 6px;
  padding: 16px;
  margin: 8px 10px;
  background: #f9fafb;
}
.nav-add-form__row {
  display: grid;
  grid-template-columns: 1fr 1.8fr 160px;
  gap: 12px;
  align-items: start;
}
.nav-add-form__field--narrow { min-width: 0; }

@media (max-width: 700px) {
  .nav-add-form__row { grid-template-columns: 1fr; }
}

.nav-add-form__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ── Auto-save status ───────────────────────────────────────────────────── */
.nav-autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  min-height: 28px;
  transition: color .2s;
}
.nav-autosave-status.is-dirty  { color: #D06228; }
.nav-autosave-status.is-saving { color: #6b7280; }
.nav-autosave-status.is-saved  { color: #16a34a; }
.nav-autosave-status.is-error  { color: #B71C2E; }

/* ── Page picker modal ──────────────────────────────────────────────────── */
#nav-page-picker {
  position: fixed;
  inset: 0;
  z-index: 9998;
}

.npp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.npp-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.npp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.npp-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.npp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: background 110ms;
}
.npp-close:hover { background: #f3f4f6; color: #111; }

/* Search */
.npp-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}
.npp-search-ico { color: #9ca3af; flex-shrink: 0; }
.npp-search {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  color: #1e1e1e;
  background: transparent;
}

/* Tabs */
.npp-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
  overflow-x: auto;
}

.npp-tab {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  transition: color 110ms, border-color 110ms;
  margin-bottom: -1px;
}
.npp-tab:hover { color: #1e1e1e; }
.npp-tab.is-active {
  color: #B71C2E;
  border-bottom-color: #B71C2E;
}

/* Panels */
.npp-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.npp-panel { display: none; }
.npp-panel.is-active { display: block; }

/* Item list */
.npp-list {
  list-style: none;
  margin: 0;
  padding: 6px 8px;
}

.npp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 100ms;
}
.npp-item:hover { background: #f3f4f6; }

.npp-item__icon { color: #6b7280; flex-shrink: 0; }
.npp-item__label { font-size: 13.5px; font-weight: 500; color: #1e1e1e; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npp-item__url   { font-size: 11.5px; color: #6b7280; font-family: 'Fira Code', monospace; flex-shrink: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.npp-item__badge {
  flex-shrink: 0;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 9px;
  background: #e5e7eb;
  color: #374151;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.npp-item__badge--draft {
  background: #fef3c7;
  color: #92400e;
}

.npp-empty {
  padding: 32px;
  text-align: center;
  color: #9ca3af;
  font-size: 13.5px;
}

/* Custom URL panel */
.npp-custom {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.npp-custom__field { display: flex; flex-direction: column; gap: 6px; }

/* ── Photo Gallery admin ─────────────────────────────────────────────────── */

.pgal-wrap { padding: 0; }

/* Dropzone */
.pgal-dropzone {
    border: 2px dashed var(--admin-border, #dee2e6);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fafbfc;
    margin-bottom: 2rem;
    user-select: none;
}
.pgal-dropzone:hover,
.pgal-dropzone.is-dragover {
    border-color: #0d6efd;
    background: #f0f5ff;
}
.pgal-dropzone__icon { color: #6c757d; margin-bottom: .75rem; display: flex; justify-content: center; }
.pgal-dropzone__title { font-weight: 600; font-size: 1.0625rem; margin: 0 0 .25rem; color: #212529; }
.pgal-dropzone__sub   { color: #6c757d; margin: 0 0 .5rem; font-size: .9rem; }
.pgal-dropzone__hint  { color: #adb5bd; font-size: .8125rem; margin: 0; }
.pgal-dropzone__browse {
    background: none; border: none; padding: 0;
    color: #0d6efd; cursor: pointer; text-decoration: underline; font: inherit;
}

/* Status bar */
.pgal-statusbar {
    padding: .625rem 1rem;
    border-radius: 6px;
    font-size: .875rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}
.pgal-statusbar--success { background: #d1e7dd; color: #0f5132; }
.pgal-statusbar--error   { background: #f8d7da; color: #842029; }
.pgal-statusbar--loading { background: #cff4fc; color: #055160; }

/* Grid */
.pgal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

/* Card */
.pgal-card {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: box-shadow .2s, opacity .2s;
    cursor: default;
}
.pgal-card.is-dragging { opacity: .45; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.pgal-card.is-editing  { box-shadow: 0 0 0 2px #0d6efd, 0 4px 16px rgba(13,110,253,.15); }
.pgal-card--uploading  { cursor: wait; }

.pgal-card__img-wrap { position: relative; aspect-ratio: 1; background: #f0f0f0; }

.pgal-card__img {
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
}
.pgal-card__img--progress { display: flex; align-items: center; justify-content: center; }

/* Overlay */
.pgal-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity .2s;
}
.pgal-card:hover .pgal-card__overlay { opacity: 1; }

/* Drag handle */
.pgal-card__drag-handle {
    position: absolute;
    top: 6px;
    left: 6px;
    color: rgba(255,255,255,.7);
    cursor: grab;
    padding: 4px;
    line-height: 1;
    opacity: 0;
    transition: opacity .2s;
}
.pgal-card:hover .pgal-card__drag-handle { opacity: 1; }
.pgal-card__drag-handle:active { cursor: grabbing; }

/* Pub dot */
.pgal-card__pub-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #adb5bd;
    border: 1.5px solid #fff;
}
.pgal-card__pub-dot.is-pub { background: #198754; }

/* Icon buttons */
.pgal-icon-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    color: #fff;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}
.pgal-icon-btn:hover { background: rgba(255,255,255,.3); transform: scale(1.1); }
.pgal-icon-btn--del:hover { background: rgba(220,53,69,.75); }
.pgal-icon-btn--pub.is-pub { background: rgba(25,135,84,.55); }

/* Upload spinner */
.pgal-upload-progress { color: #6c757d; animation: pgalSpin .9s linear infinite; }
@keyframes pgalSpin { to { transform: rotate(360deg); } }

/* Card footer */
.pgal-card__footer {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-height: 36px;
}
.pgal-card__label { font-size: .75rem; color: #495057; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pgal-card__dim   { font-size: .6875rem; color: #adb5bd; white-space: nowrap; }

/* Inline meta panel */
.pgal-meta-panel {
    padding: 12px 12px 10px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.pgal-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.pgal-field__label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; }
.pgal-field__input {
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: .8125rem;
    font-family: inherit;
    color: #212529;
    background: #fff;
    transition: border-color .15s;
    width: 100%;
    box-sizing: border-box;
}
.pgal-field__input:focus { outline: none; border-color: #0d6efd; box-shadow: 0 0 0 2px rgba(13,110,253,.15); }
.pgal-field__textarea { resize: vertical; min-height: 52px; }

.pgal-checkbox {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8125rem;
    color: #495057;
    margin-bottom: 10px;
    cursor: pointer;
}

.pgal-meta-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Empty state */
.pgal-empty { text-align: center; color: #6c757d; padding: 2rem 0; font-size: .9375rem; }
