/* =====================================================
   SpectrumWho — App Stylesheet
   FRC Team 3847 Spectrum
   Design system: dark theme, purple accent
   ===================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg:          #111111;
  --surface:     #1e1e1e;
  --surface2:    #252525;
  --border:      #333333;
  --text:        #f0f0f0;
  --muted:       #888888;
  --purple:      #b07cff;
  --purple-btn:  #7c3aed;
  --purple-hover:#6d28d9;
  --success:     #10b981;
  --warning:     #f59e0b;
  --error:       #ef4444;
  --radius-card: 8px;
  --radius-input:6px;
  --radius-pill: 9999px;
  --font: "Segoe UI", system-ui, sans-serif;
  --transition: 0.18s ease;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--purple);
  text-decoration: none;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-card);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
  border: none;
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--purple-btn);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--purple-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--purple);
  border: 1.5px solid var(--purple);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(176,124,255,0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--muted);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1.5px solid var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.1);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ---------- Inputs ---------- */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 12px;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--purple-btn);
}

select {
  appearance: none;
  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 fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

::placeholder {
  color: var(--muted);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.form-row {
  display: grid;
  gap: 12px;
}

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

/* ---------- Badges / Pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-purple {
  background: rgba(124,58,237,0.25);
  color: var(--purple);
  border: 1px solid rgba(176,124,255,0.3);
}

.badge-admin {
  background: rgba(245,158,11,0.2);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.35);
}

.badge-year {
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.3);
}

/* ---------- Spinner ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--purple-btn);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-card);
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  min-width: 240px;
  max-width: 360px;
  pointer-events: all;
  animation: toast-in 0.25s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast-success { border-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-error { border-color: var(--error); }
.toast-error .toast-icon { color: var(--error); }

.toast-info { border-color: var(--purple); }
.toast-info .toast-icon { color: var(--purple); }

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-text { flex: 1; }

/* ---------- Screen: Login ---------- */
#screen-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.login-logo {
  margin: 0 auto 24px;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 36px;
}

.btn-google {
  width: 100%;
  justify-content: center;
  padding: 12px 18px;
  font-size: 15px;
}

.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

#pending-box {
  margin-top: 24px;
  padding: 16px;
  background: rgba(245,158,11,0.08);
  border: 1.5px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-card);
  text-align: left;
}

#pending-box p {
  font-size: 13px;
  color: var(--warning);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ---------- Screen: App ---------- */
#screen-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ---------- */
#app-header {
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--purple);
  white-space: nowrap;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.nav-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.nav-tab.active {
  color: var(--purple);
  background: rgba(124,58,237,0.15);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface2);
}

.header-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- App Content ---------- */
#app-content {
  flex: 1;
  padding: 28px 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- View: Directory ---------- */
.directory-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.directory-controls input[type="text"] {
  flex: 1;
  min-width: 180px;
}

.directory-controls select {
  width: auto;
  min-width: 150px;
  flex-shrink: 0;
}

/* ---------- Profile Cards Grid ---------- */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* Skeleton loading cards */
.skeleton-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface2);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-body {
  padding: 12px;
}

.skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: var(--surface2);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  margin-bottom: 8px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Profile card */
.profile-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.profile-card:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 20px rgba(124,58,237,0.18);
  transform: translateY(-2px);
}

.card-photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface2);
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.profile-card:hover .card-photo {
  transform: scale(1.04);
}

.card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  color: var(--muted);
  font-size: 48px;
  font-weight: 700;
}

.card-body {
  padding: 12px 14px 14px;
}

.card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.card-birthday-badge {
  font-size: 12px;
  color: var(--warning);
  font-weight: 600;
}

.card-favorites {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.fav-chip {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto;
}

/* ---------- View: Edit Profile ---------- */
#view-edit {
  max-width: 680px;
  margin: 0 auto;
}

.edit-header {
  margin-bottom: 28px;
}

.edit-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.edit-header p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.form-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Photo upload section */
.photo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.photo-preview-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.photo-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-placeholder {
  font-size: 48px;
  color: var(--muted);
}

.photo-upload-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.uploading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* More photos grid */
.more-photos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.more-photo-slot {
  aspect-ratio: 1;
  background: var(--surface2);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}

.more-photo-slot:hover {
  border-color: var(--purple);
}

.more-photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-photo-actions {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity var(--transition);
}

.more-photo-slot:hover .more-photo-actions {
  opacity: 1;
}

.more-photo-slot .add-icon {
  font-size: 28px;
  color: var(--muted);
  pointer-events: none;
}

.more-photo-slot .add-label {
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

/* Char counter */
.char-counter {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

.char-counter.near-limit { color: var(--warning); }
.char-counter.at-limit   { color: var(--error); }

/* Info box */
.info-box {
  background: rgba(176,124,255,0.06);
  border: 1.5px solid rgba(176,124,255,0.25);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--purple);
  line-height: 1.5;
}

/* Save bar */
.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  padding: 14px 24px;
  margin: 0 -24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  z-index: 10;
  margin-top: 24px;
}

/* ---------- Profile Modal ---------- */
#profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  cursor: pointer;
}

.modal-box {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.4);
  border: 1.5px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background var(--transition);
  z-index: 2;
}

.modal-close:hover {
  background: rgba(255,255,255,0.1);
}

.modal-hero {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}

.modal-hero-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  font-size: 80px;
  color: var(--muted);
}

.modal-body {
  padding: 24px 28px 28px;
}

.modal-name-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.modal-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  flex: 1;
}

.modal-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.modal-birthday {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-birthday.today-birthday {
  color: var(--warning);
  font-weight: 700;
}

.modal-bio {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin: 14px 0;
  white-space: pre-wrap;
}

.modal-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
  margin-top: 20px;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fav-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
}

.fav-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 3px;
}

.fav-card-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

/* Photo gallery strip */
.photo-strip {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.photo-strip::-webkit-scrollbar { height: 4px; }
.photo-strip::-webkit-scrollbar-track { background: transparent; }
.photo-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.strip-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-card);
  object-fit: cover;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
}

.strip-thumb:hover {
  border-color: var(--purple);
}

/* ---------- Settings Modal (Admin) ---------- */
#settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.settings-modal-box {
  max-width: 480px;
}

.settings-modal-header {
  padding: 22px 28px 0;
}

.settings-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -0.3px;
}

.settings-modal-body {
  padding: 20px 28px 28px;
}

.settings-token-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.settings-token-row input {
  flex: 1;
}

.settings-token-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

.settings-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ---------- Admin: Settings gear button ---------- */
.btn-settings {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.btn-settings:hover {
  color: var(--purple);
  border-color: var(--purple);
  background: rgba(176,124,255,0.08);
}

/* ---------- Admin Moderation Section (inside profile modal) ---------- */
.admin-moderation {
  margin-top: 28px;
  border: 1.5px solid var(--error);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.admin-moderation-header {
  background: rgba(239,68,68,0.06);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
  color: var(--error);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.admin-moderation-header:hover {
  background: rgba(239,68,68,0.12);
}
.admin-moderation-chevron {
  font-size: 10px;
  transition: transform 0.2s;
  opacity: 0.7;
}
.admin-moderation.open .admin-moderation-chevron {
  transform: rotate(180deg);
}
.admin-moderation.open .admin-moderation-header {
  border-bottom: 1px solid rgba(239,68,68,0.25);
}

.admin-moderation-body {
  padding: 14px 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.admin-moderation.open .admin-moderation-body {
  display: flex;
}

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

.admin-mod-label {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.admin-mod-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.admin-mod-thumb-wrap {
  position: relative;
  display: inline-block;
}

.admin-mod-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border);
  display: block;
}

.admin-mod-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.admin-mod-thumb-del:hover {
  background: #c53030;
}

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 20px;
}

#lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  cursor: default;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .profiles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  #app-content {
    padding: 16px;
  }

  .profiles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .header-username {
    display: none;
  }

  .favorites-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .more-photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-body {
    padding: 18px 18px 24px;
  }

  .modal-name {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .profiles-grid {
    grid-template-columns: 1fr;
  }

  #app-header {
    padding: 0 14px;
  }

  .login-card {
    padding: 36px 24px;
  }

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

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

  .directory-controls {
    flex-direction: column;
  }

  .directory-controls select {
    width: 100%;
  }

  .save-bar {
    padding: 12px 16px;
  }
}
