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

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e4e9;
  --text: #1a1d23;
  --text-secondary: #6b7280;
  --primary: #1a6b8a;
  --primary-hover: #155a75;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --header-h: 56px;
  --nav-h: 44px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

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

/* ── LOGIN ─────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f3f52 0%, #1a6b8a 100%);
}
.login-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-logo { font-size: 48px; margin-bottom: 16px; }
.login-box h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-box > p { color: var(--text-secondary); margin-bottom: 28px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-form input[type="email"],
#login-form input[type="password"],
#login-form input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
#login-form input:focus { border-color: var(--primary); }

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input-wrap input {
  padding-right: 44px !important;
}
.toggle-pw-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  padding: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.toggle-pw-btn:hover { opacity: 1; }

.login-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}
.forgot-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

.login-submit {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  border-radius: var(--radius);
  margin-top: 2px;
}

.login-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* ── HEADER ─────────────────────────────────────────── */
#admin-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #0f3f52;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo { font-size: 22px; }
.header-title { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.header-actions { display: flex; gap: 8px; }

/* ── NAV ─────────────────────────────────────────────── */
#admin-nav {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  z-index: 90;
}
.nav-tab {
  padding: 0 20px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-tab:hover { color: var(--primary); }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── MAIN ─────────────────────────────────────────────── */
#admin-main {
  margin-top: calc(var(--header-h) + var(--nav-h));
  padding: 24px;
  max-width: 900px;
}

#section-header {
  margin-bottom: 20px;
}
.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
#section-title { font-size: 20px; font-weight: 700; }
.item-count {
  font-size: 12px;
  background: var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.section-actions {
  display: flex;
  gap: 10px;
}
#section-search {
  flex: 1;
  max-width: 280px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
#section-search:focus { border-color: var(--primary); }

/* ── LIST ─────────────────────────────────────────────── */
.item-list { display: flex; flex-direction: column; gap: 8px; }

.item-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
}
.item-row:hover { border-color: var(--primary); }
.item-num { font-size: 11px; font-weight: 600; color: var(--text-secondary); width: 24px; text-align: right; flex-shrink: 0; }
.item-emoji { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.item-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── BUTTONS ─────────────────────────────────────────── */
button { cursor: pointer; font-family: inherit; }
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
#admin-main .btn-ghost {
  border-color: var(--border);
  color: var(--text-secondary);
}
#admin-main .btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-danger:hover { background: var(--danger-hover); }

/* ── MODAL ─────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
#modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  margin: auto;
}
#modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#modal-title { font-size: 17px; font-weight: 700; }
.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close-btn:hover { color: var(--text); }
#modal-body { padding: 20px 24px; overflow-y: auto; max-height: 70vh; }
#modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-footer-right { display: flex; gap: 8px; }

/* ── FORM ─────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.checkbox-row label { font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; }

.checkboxes-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.form-section-divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ── EXPORT SECTION ─────────────────────────────────── */
.export-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.export-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.export-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.export-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.export-card .btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.export-card.danger-zone {
  border-color: #fca5a5;
  background: #fff5f5;
}
.export-card.danger-zone h3 { color: var(--danger); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat-pill {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.stat-num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.password-row { display: flex; gap: 8px; align-items: center; }
.password-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.password-row input:focus { border-color: var(--primary); }

.import-drop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.import-drop:hover { background: var(--primary-hover); }
.import-drop input { display: none; }

.unsaved-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

/* ── Photo upload ──────────────────────────────────────────────────────────── */
.photo-upload-group { flex-direction: column; gap: 8px; }
.photo-preview {
  width: 100%; max-height: 200px; object-fit: cover;
  border-radius: 8px; border: 1.5px solid var(--border);
}
.photo-preview--empty {
  height: 80px; display: flex; align-items: center; justify-content: center;
  background: #f8fafc; color: var(--text-secondary); font-size: 13px;
  border-radius: 8px; border: 1.5px dashed var(--border);
}
.photo-upload-label {
  display: inline-block; cursor: pointer;
}
.photo-upload-label span {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f0f4f8; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.photo-upload-label:hover span { border-color: var(--primary); background: #e8f0fe; }

.photo-credit-input {
  margin-top: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  box-sizing: border-box;
}
.photo-credit-input::placeholder { color: var(--text-secondary); }
.photo-credit-input:focus { outline: none; border-color: var(--primary); }

/* ── Coord picker ─────────────────────────────────────────────────────────── */
.coord-picker-group { flex-direction: column; gap: 6px; }
.coord-inputs-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.coord-input { flex: 1; min-width: 120px; }
.pick-on-map-btn { white-space: nowrap; flex-shrink: 0; }

/* ── Map picker overlay ───────────────────────────────────────────────────── */
#map-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: #000;
}

#map-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}

#map-picker-hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

#map-picker-map {
  flex: 1;
  width: 100%;
}

#map-picker-coords {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 20px;
  pointer-events: none;
  font-family: monospace;
}

/* ── GPS user dot (shared with app) ──────────────────────────────────────── */
#user-location-dot, #picker-user-dot {
  position: relative;
  width: 20px;
  height: 20px;
}
.user-dot-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: rgba(41, 128, 185, 0.25);
  animation: pulse-ring 2s ease-out infinite;
}
.user-dot-core {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #2980b9;
  border: 2.5px solid white;
  box-shadow: 0 2px 8px rgba(41,128,185,0.6);
}
.user-dot-arrow {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid #2980b9;
  transform-origin: 50% calc(100% + 11px);
}
@keyframes pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.8; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}
#map-picker-track.active {
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Multi-photo editor ──────────────────────────────────────────────────── */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  min-height: 40px;
}
.photo-grid-empty {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 0;
}
.photo-grid-item {
  position: relative;
  width: 160px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  cursor: grab;
  background: #f8fafc;
}
.photo-credit-fields { padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 3px; }
.photo-credit-inline {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
  cursor: text;
}
.photo-credit-inline::placeholder { color: var(--text-secondary); }
.photo-credit-inline:focus { outline: none; border-color: var(--primary); }

.photo-rights-btn {
  width: 100%;
  margin-top: 2px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  text-align: left;
  transition: border-color 0.15s, color 0.15s;
}
.photo-rights-btn:hover, .photo-rights-btn.has-rights { border-color: var(--primary); color: var(--primary); }

.rights-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.rights-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.rights-panel-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 1rem; line-height: 1;
}
.rights-panel-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.rights-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.rights-label input, .rights-label select {
  background: var(--input-bg, var(--surface));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.82rem;
  color: var(--text-primary);
  width: 100%;
  box-sizing: border-box;
}
.rights-label input:focus, .rights-label select:focus { outline: none; border-color: var(--primary); }
.rights-derived-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rights-panel-actions { display: flex; gap: 8px; margin-top: 4px; }
.rights-panel-hint { font-size: 0.78rem; color: #888; margin: 8px 0 0; text-align: center; }

.photo-grid-item.dragging { opacity: 0.4; }
.photo-grid-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,107,138,0.2); }
.photo-thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.photo-drag-handle {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.5);
  color: white;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  cursor: grab;
}
.photo-thumb-wrap {
  position: relative;
  line-height: 0;
}
.photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.photo-primary-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26,107,138,0.85);
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

/* ── Highlights field ───────────────────────────────────────────────────── */
.highlight-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.highlight-suggestion {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.highlight-suggestion:hover {
  background: rgba(26,107,138,0.08);
  border-color: var(--primary);
}

/* ── Emoji picker ───────────────────────────────────────────────────────── */
.emoji-picker {
  position: absolute;
  z-index: 200;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--border, #d8e4ea);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.14);
  width: 280px;
  max-height: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 4px;
}
.emoji-picker-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border, #d8e4ea);
  padding: 4px 6px 0;
  gap: 2px;
  flex-shrink: 0;
  scrollbar-width: none;
}
.emoji-picker-tabs::-webkit-scrollbar { display: none; }
.emoji-tab {
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #666);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.emoji-tab.active {
  color: var(--primary, #1a6b8a);
  border-bottom-color: var(--primary, #1a6b8a);
}
.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  overflow-y: auto;
}
.emoji-grid.hidden { display: none; }
.emoji-btn {
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  line-height: 1;
}
.emoji-btn:hover { background: var(--fog, #f0f4f7); }

/* Ensure the emoji form-group is positioned for the absolute picker */
.form-group:has([name="emoji"]) {
  position: relative;
}

/* ── Sort bar ───────────────────────────────────────────────────────────────── */
.csv-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.csv-bar-btn {
  cursor: pointer;
  font-size: 0.8rem;
}
.csv-bar-upload {
  display: inline-flex;
  align-items: center;
}
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sort-label {
  font-size: 0.78rem;
  color: var(--text-secondary, #666);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.sort-btn {
  background: none;
  border: 1px solid var(--border, #ddd);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-secondary, #555);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sort-btn:hover { background: var(--fog, #f0f4f7); border-color: var(--primary, #1a6b8a); color: var(--primary, #1a6b8a); }
.sort-btn.active { background: var(--primary, #1a6b8a); border-color: var(--primary, #1a6b8a); color: #fff; }
.sort-btn.active:hover { background: var(--primary-dark, #155a75); }
.sort-badge {
  background: #ef4444;
  color: #fff;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  line-height: 1.4;
}
.sort-btn.active .sort-badge { background: rgba(255,255,255,0.3); }

/* ── Item row: no-photo state ───────────────────────────────────────────────── */
.item-row--no-photo { border-left: 3px solid #f59e0b; }
.item-row--no-rights { border-left: 3px solid #6366f1; }

/* Filter highlights — only show when that filter is active */
.item-list[data-sort="no-photo"] .item-row--no-photo   { background: #fef9ec; }
.item-list[data-sort="has-photo"] .item-row--has-photo  { background: #f0faf2; border-left: 3px solid #22c55e; }
.sort-badge--green { background: #22c55e; }
.sort-badge--yellow { background: #f59e0b; }
.item-list[data-sort="no-rights"] .item-row--no-rights { background: #f0f0ff; }
.item-list[data-sort="has-rights"] .item-row--has-rights { background: #f0faf2; border-left: 3px solid #22c55e; }
.item-emoji { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.no-photo-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 0.65rem;
  background: #fef3c7;
  border-radius: 50%;
  padding: 1px;
  line-height: 1;
  opacity: 0.85;
}

/* ── Updated timestamp ──────────────────────────────────────────────────────── */
.item-updated {
  font-size: 0.7rem;
  color: var(--text-secondary, #888);
  font-weight: 400;
  margin-left: 8px;
  vertical-align: middle;
}
