/* ─────────────────────────────────────────────────────────────────────────────
   PhotoShare — Global CSS
   Font: Inter (loaded via base.html)
   Theme: Dark mode with violet accent
   ───────────────────────────────────────────────────────────────────────────── */

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

:root {
  /* Colours */
  --bg:       #0f1117;
  --bg2:      #1a1d27;
  --bg3:      #222639;
  --bg4:      #2a2e45;
  --border:   #2e3249;
  --text:     #e8eaf0;
  --text2:    #9097b8;
  --text3:    #6b7199;
  --accent:   #6c63ff;
  --accent2:  #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --success:  #22c55e;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --radius:   12px;
  --radius-sm: 8px;
  --shadow:   0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  /* safe area for mobile notches */
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  background: rgba(26, 29, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-icon { font-size: 1.3rem; }
.brand-name { background: linear-gradient(135deg, var(--accent2), #c4b5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 44px; /* touch target */
  display: flex;
  align-items: center;
}
.nav-link:hover, .nav-link.active { background: var(--bg3); color: var(--text); }
.nav-link-admin { color: var(--warning) !important; }
.nav-link-admin:hover { background: rgba(245, 158, 11, 0.1) !important; }

.nav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-username { font-size: 0.85rem; color: var(--text2); display: none; }
@media (min-width: 768px) { .nav-username { display: block; } }

.avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg2), 0 0 0 3px var(--accent);
}

/* ── Hamburger ────────────────────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger:hover { border-color: var(--accent); }
.hamburger:hover span { background: var(--accent); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
  .hamburger { display: flex; }
  .nav-links, #logout-btn { display: none; }
  .navbar { padding: 0 1rem; }
}

/* ── Mobile slide-out nav ─────────────────────────────────────────────────── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s;
}
.mobile-nav-overlay.open { display: block; opacity: 1; }

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 320px);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 301;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  overflow-y: auto;
}
.mobile-nav.open { transform: translateX(0); }

.mobile-nav-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.avatar-lg {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.mobile-nav-links { display: flex; flex-direction: column; gap: 4px; padding: 1rem; flex: 1; }
.mobile-nav-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-nav-link:hover { background: var(--bg3); color: var(--text); }
.mobile-nav-admin { color: var(--warning); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 2rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.page-header p { color: var(--text2); font-size: 0.95rem; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}
.card-sm { padding: 1rem; }
.card:hover { border-color: rgba(108,99,255,0.3); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  min-height: 44px; /* a11y touch target */
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  box-shadow: 0 2px 12px rgba(108,99,255,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(108,99,255,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.88; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.88; }
.btn-warning { background: var(--warning); color: #111; }
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--text3); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; min-height: 36px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  min-height: 44px;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text3); }
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text2); font-weight: 500; }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 4px; }
select.form-input { cursor: pointer; }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(108,99,255,0.15), transparent);
}
.auth-box { width: 100%; max-width: 420px; }
.auth-box .logo { text-align: center; margin-bottom: 2rem; }
.auth-box .logo h1 { font-size: 1.9rem; font-weight: 700; background: linear-gradient(135deg, var(--accent2), #c4b5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-box .logo p { color: var(--text2); margin-top: 6px; font-size: 0.9rem; }
.auth-box .card { padding: 2rem; box-shadow: var(--shadow); }
.auth-link { text-align: center; margin-top: 1.2rem; font-size: 0.875rem; color: var(--text2); }
.auth-link a { color: var(--accent2); text-decoration: none; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.messages-container { padding: 0 2rem; margin-top: 1rem; }
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: inherit; opacity: 0.6; line-height: 1; padding: 0 4px; }
.alert-close:hover { opacity: 1; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--success); }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: var(--danger);  }
.alert-info    { background: rgba(108,99,255,0.1); border: 1px solid rgba(108,99,255,0.3); color: var(--accent2); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }
@media (max-width: 767px) { .messages-container { padding: 0 1rem; } }

/* ── Photo grid ───────────────────────────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.photo-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.photo-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(108,99,255,0.2);
}
.photo-card:active { transform: translateY(-1px); }
.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg3);
  transition: transform 0.3s ease;
}
.photo-card:hover img { transform: scale(1.04); }
.photo-card .photo-name {
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skeleton loader for images not yet loaded */
.photo-card img[src=""],
.photo-card img:not([src]) {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Folder cards ─────────────────────────────────────────────────────────── */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.folder-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: var(--transition);
}
.folder-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(108,99,255,0.2);
}
.folder-card .folder-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg3);
  transition: transform 0.3s ease;
}
.folder-card:hover .folder-thumb { transform: scale(1.04); }
.folder-card .folder-fallback {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  font-size: 3rem;
}
.folder-card .folder-info {
  padding: 10px 12px;
}
.folder-card .folder-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-card .folder-count { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }

/* ── Status badges ────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; line-height: 1.4; }
.badge-pending  { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-approved { background: rgba(34,197,94,0.15);  color: var(--success); }
.badge-denied   { background: rgba(239,68,68,0.15);  color: var(--danger);  }
.badge-info     { background: rgba(108,99,255,0.15); color: var(--accent2); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 10px 14px; font-size: 0.78rem; color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); letter-spacing: 0.04em; text-transform: uppercase; }
.table td { padding: 13px 14px; font-size: 0.9rem; border-bottom: 1px solid rgba(46,50,73,0.5); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.table-responsive { overflow-x: auto; }

/* ── Stat cards ───────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
}
.stat-card .stat-value { font-size: 2.2rem; font-weight: 700; color: var(--accent2); line-height: 1; }
.stat-card .stat-label { font-size: 0.82rem; color: var(--text2); margin-top: 6px; font-weight: 500; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--text2); }
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1.25rem; display: block; }
.empty-state h3 { font-size: 1.25rem; color: var(--text); margin-bottom: 10px; font-weight: 600; }
.empty-state p { font-size: 0.9rem; margin-bottom: 1.75rem; max-width: 380px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-img { max-width: 92vw; max-height: 92vh; border-radius: var(--radius); box-shadow: var(--shadow); }
.modal-close {
  position: fixed;
  top: 16px;
  right: 20px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

/* ── Checkbox grid for assign ─────────────────────────────────────────────── */
.photo-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 520px; overflow-y: auto; padding: 4px; }
.photo-check-item { position: relative; }
.photo-check-item input[type=checkbox] { display: none; }
.photo-check-item label {
  display: block;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.photo-check-item input:checked + label { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.photo-check-item label img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-check-item label .name { padding: 6px 8px; font-size: 0.72rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-check-item .check-mark {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: white;
  box-shadow: 0 0 8px rgba(108,99,255,0.5);
}
.photo-check-item input:checked ~ .check-mark { display: flex; }

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-bar { display: flex; gap: 10px; margin-bottom: 1.5rem; }
.search-bar input { flex: 1; }

/* ── Section title ────────────────────────────────────────────────────────── */
.section-title { font-size: 0.72rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }

/* ── PWA Install Banner ───────────────────────────────────────────────────── */
.pwa-install-banner {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(90vw, 440px);
  z-index: 500;
  box-shadow: var(--shadow);
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.pwa-install-banner[hidden] { display: none; }
.pwa-install-icon { font-size: 2rem; flex-shrink: 0; }
.pwa-install-text { flex: 1; min-width: 0; }
.pwa-install-text strong { display: block; font-size: 0.9rem; color: var(--text); }
.pwa-install-text span { font-size: 0.8rem; color: var(--text2); }
.pwa-install-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  min-width: 36px;
  text-align: center;
  transition: var(--transition);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent2); }
.pagination .current { background: var(--accent); color: white; border-color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .container { padding: 1rem; }
  .page-header h1 { font-size: 1.4rem; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .photo-check-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .table th, .table td { padding: 10px; font-size: 0.82rem; }
  .messages-container { padding: 0 1rem; }
}

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

/* ── Focus styles (a11y) ──────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   AUTH PAGES — Split panel layout
   ───────────────────────────────────────────────────────────────────────────── */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

/* ── Left hero panel ── */
.auth-hero {
  display: none; /* hidden on mobile */
  flex: 1;
  background: linear-gradient(160deg, #1a1340 0%, #0f1117 40%, #1a1340 100%);
  position: relative;
  overflow: hidden;
  padding: 3rem;
}
.auth-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(108,99,255,0.25) 0%, transparent 70%);
  pointer-events: none;
}
.auth-hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(139,131,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.auth-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}
.auth-hero-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 24px rgba(108,99,255,0.6));
}
.auth-hero-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}
.auth-hero-subtitle {
  color: rgba(255,255,255,0.65);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 340px;
  margin-bottom: 2rem;
}
.auth-hero-dots { display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.dot-active { background: var(--accent2); width: 24px; border-radius: 4px; }
.auth-hero-features { display: flex; flex-direction: column; gap: 10px; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.8);
  font-size: .9rem;
}
.auth-feature span { color: var(--success); font-weight: 700; }

/* ── Right form panel ── */
.auth-panel {
  flex: 0 0 min(460px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
  position: relative;
}
.auth-panel-scroll {
  align-items: flex-start;
  overflow-y: auto;
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.auth-form-wrap {
  width: 100%;
  max-width: 380px;
}

/* Logo */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}
.auth-logo-icon { font-size: 1.6rem; }
.auth-logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent2), #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.025em;
}
.auth-subheading {
  color: var(--text2);
  font-size: .9rem;
  margin-bottom: 1.75rem;
}

/* Form */
.auth-form { width: 100%; }

/* Input with icon */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}
.input-icon-wrap .form-input {
  padding-left: 38px;
  padding-right: 44px;
}

/* Password toggle */
.pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 1;
}
.pw-toggle:hover { color: var(--text); }

/* Full-width button */
.btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
  min-height: 46px;
  font-size: .95rem;
}

/* Spinner inside button */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; transform-origin: center; }

/* Footer link */
.auth-footer-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .875rem;
  color: var(--text2);
}
.auth-footer-link a { color: var(--accent2); text-decoration: none; font-weight: 600; }
.auth-footer-link a:hover { text-decoration: underline; }

/* Required star */
.req-star { color: var(--danger); margin-left: 2px; font-size: .8rem; }
.form-help { font-size: .78rem; color: var(--text2); margin-top: 4px; line-height: 1.5; }

/* Selfie drag-and-drop zone */
.selfie-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg3);
  position: relative;
  min-height: 140px;
}
.selfie-zone:hover, .selfie-zone.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,0.06);
}
.selfie-zone.has-preview { border-style: solid; border-color: var(--accent); }
.selfie-zone-inner { position: relative; min-height: 140px; }
.selfie-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text2);
  min-height: 140px;
}
.selfie-placeholder strong { color: var(--text); font-size: .9rem; }
.selfie-placeholder span { font-size: .83rem; }
.selfie-preview-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
.selfie-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Show on desktop */
@media (min-width: 900px) {
  .auth-hero { display: flex; flex-direction: column; }
  .auth-panel { flex: 0 0 min(480px, 50%); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   GALLERY — Dashboard & Folder views
   ───────────────────────────────────────────────────────────────────────────── */

.gallery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.gallery-header h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 4px; }
.gallery-subtitle { color: var(--text2); font-size: .9rem; }
.gallery-count { font-weight: 600; color: var(--accent2); }
.gallery-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Search bar */
.gallery-search-bar { margin-bottom: 1.5rem; }
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 380px;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text3);
  pointer-events: none;
}
.search-input { padding-left: 38px; padding-right: 36px; }
.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: .85rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .2s;
}
.search-clear:hover { color: var(--text); }

/* Folder grid */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.folder-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: var(--transition);
}
.folder-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(108,99,255,0.2);
}
.folder-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg3);
}
.folder-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.folder-card:hover .folder-thumb { transform: scale(1.06); }
.folder-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
}
.folder-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
  opacity: 0;
  transition: opacity .25s;
}
.folder-card:hover .folder-overlay { opacity: 1; }
.folder-info { padding: 10px 12px; }
.folder-name {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-count { font-size: .75rem; color: var(--text2); margin-top: 2px; display: block; }

/* Photo card overlay on hover */
.photo-card { position: relative; }
.photo-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(108,99,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  border-radius: inherit;
}
.photo-card:hover .photo-card-overlay { opacity: 1; }

/* List view */
.photo-list { display: flex; flex-direction: column; gap: 6px; }
.photo-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.photo-list-item:hover { border-color: var(--accent); background: var(--bg3); }
.photo-list-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.photo-list-info { flex: 1; min-width: 0; }
.photo-list-name { display: block; font-size: .9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-list-meta { display: block; font-size: .78rem; color: var(--text2); margin-top: 2px; }

/* View toggle */
.gallery-toolbar { display: flex; align-items: center; gap: 10px; }
.view-toggle { display: flex; gap: 2px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.view-btn { background: none; border: none; color: var(--text2); cursor: pointer; padding: 6px 8px; border-radius: 6px; display: flex; align-items: center; transition: var(--transition); }
.view-btn.active { background: var(--accent); color: white; }
.view-btn:hover:not(.active) { background: var(--bg4); color: var(--text); }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.bc-link { color: var(--text2); text-decoration: none; font-size: .85rem; display: flex; align-items: center; gap: 4px; transition: color .2s; }
.bc-link:hover { color: var(--accent2); }
.bc-sep { color: var(--text3); flex-shrink: 0; }
.bc-current { font-size: .85rem; color: var(--text); font-weight: 500; }
.pb-header-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* Lightbox improvements */
.modal-content { text-align: center; }
.modal-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-name { color: rgba(255,255,255,0.85); font-size: .9rem; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-drive-btn { color: white !important; border-color: rgba(255,255,255,0.3) !important; }

/* Empty state hero variant */
.empty-state-hero { padding: 6rem 2rem; }
.empty-state .empty-status { margin-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }

/* ─────────────────────────────────────────────────────────────────────────────
   PROFILE PAGE
   ───────────────────────────────────────────────────────────────────────────── */

.profile-container { max-width: 900px; }

.profile-hero-card {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  display: block;
}
.profile-avatar-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  border: 3px solid rgba(108,99,255,0.4);
}
.profile-avatar-status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: white;
}
.status-ok { background: var(--success); }
.status-warn { background: var(--danger); }
.status-pending { background: var(--warning); }

.profile-hero-info { flex: 1; min-width: 200px; }
.profile-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.profile-email { color: var(--text2); font-size: .875rem; display: block; margin-bottom: 12px; }
.profile-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.profile-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 700px) { .profile-grid { grid-template-columns: 1fr 1.2fr; } }

.profile-card { }
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.card-subtitle { font-size: .875rem; color: var(--text2); margin-bottom: 1.25rem; line-height: 1.6; }

.profile-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.profile-detail-item { display: flex; flex-direction: column; gap: 4px; }
.full-width { grid-column: 1 / -1; }
.profile-detail-label { font-size: .78rem; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.profile-detail-value { font-size: .9rem; color: var(--text); background: var(--bg3); padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); word-break: break-all; }

.profile-selfie-zone { margin-bottom: .5rem; }

.profile-tips {
  background: rgba(108,99,255,0.07);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 1rem;
}
.profile-tips-title { font-size: .83rem; font-weight: 600; color: var(--accent2); margin-bottom: 6px; }
.profile-tips-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-tips-list li { font-size: .8rem; color: var(--text2); padding-left: 16px; position: relative; }
.profile-tips-list li::before { content: '•'; position: absolute; left: 4px; color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────────────
   ADMIN DASHBOARD
   ───────────────────────────────────────────────────────────────────────────── */

.admin-badge-icon {
  width: 42px;
  height: 42px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Stat cards with icon */
.stat-card { position: relative; overflow: hidden; }
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: .75rem;
}
.stat-icon-blue   { background: rgba(59,130,246,0.15); }
.stat-icon-green  { background: rgba(34,197,94,0.15); }
.stat-icon-yellow { background: rgba(245,158,11,0.15); }
.stat-icon-purple { background: rgba(139,131,255,0.15); }
.stat-icon-gray   { background: rgba(144,151,184,0.15); }

/* Quick actions */
.quick-actions { margin-bottom: 2rem; }
.quick-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.quick-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  background: var(--bg2);
  transition: var(--transition);
}
.quick-action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-action-card.qa-purple { background: rgba(108,99,255,0.08); border-color: rgba(108,99,255,0.3); }
.quick-action-card.qa-purple:hover { border-color: var(--accent); }
.quick-action-card.qa-ghost { background: transparent; }
.qa-icon { font-size: 1.4rem; flex-shrink: 0; }
.qa-info { flex: 1; min-width: 0; }
.qa-info strong { display: block; font-size: .9rem; color: var(--text); margin-bottom: 2px; }
.qa-info span { font-size: .78rem; color: var(--text2); }

/* Admin section */
.admin-section { margin-bottom: 2rem; }
.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--warning);
  color: #111;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 8px;
}

/* Add folder form */
.add-folder-form { padding: 1.2rem; border-top: 1px solid var(--border); }
.add-folder-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-folder-row .form-input { flex: 1; min-width: 160px; }

/* Mono code */
.mono-code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: .82rem; background: var(--bg3); padding: 2px 6px; border-radius: 4px; color: var(--text2); word-break: break-all; }

/* User mini avatars in table */
.user-mini-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}



/* ─────────────────────────────────────────────────────────────────────────────
   SELFIE TABS + CAMERA UI
   ───────────────────────────────────────────────────────────────────────────── */

.selfie-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: .5rem;
}
.selfie-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text2);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
  min-height: 38px;
}
.selfie-tab.active { background: var(--accent); color: white; }
.selfie-tab:hover:not(.active) { background: var(--bg4); color: var(--text); }

.selfie-panel { }

/* Camera zone */
.camera-zone {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  position: relative;
  min-height: 160px;
}
.camera-video {
  width: 100%;
  display: none;
  border-radius: 0;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.camera-captured-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.camera-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  background: rgba(0,0,0,0.7);
  justify-content: center;
}
.camera-zone:not(:has(.camera-video[style*="block"])):not(:has(.camera-captured-img)) .camera-controls {
  /* show controls at center when nothing showing */
  position: static;
}

/* Field row for side-by-side inputs */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   MOBILE-FIRST IMPROVEMENTS
   ───────────────────────────────────────────────────────────────────────────── */

/* Auth wrap: full-width form on mobile; split on desktop */
@media (max-width: 899px) {
  .auth-wrap { flex-direction: column; min-height: 100vh; }
  .auth-panel {
    flex: 1;
    align-items: flex-start;
    overflow-y: auto;
    padding: 1.5rem 1rem 3rem;
    justify-content: center;
  }
  .auth-form-wrap { max-width: 100%; }
  .auth-heading { font-size: 1.5rem; }
  .auth-subheading { font-size: .85rem; margin-bottom: 1.25rem; }
  .auth-logo { margin-bottom: 1.5rem; }

  /* Compact logo on mobile */
  .auth-logo-text { font-size: 1.1rem; }
}

/* Stack profile grid on mobile */
@media (max-width: 699px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-detail-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .profile-hero-card { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.25rem; }
  .profile-name { font-size: 1.2rem; }
}

/* Gallery on mobile */
@media (max-width: 480px) {
  .gallery-header { flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
  .gallery-header h1 { font-size: 1.35rem; }
  .gallery-header-right { width: 100%; }
  .gallery-search-bar .search-input-wrap { max-width: 100%; }
  .folder-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pb-header-row { flex-direction: column; }
  .gallery-toolbar { width: 100%; }
  .gallery-toolbar .search-input-wrap { flex: 1; max-width: 100%; }
}

/* Admin dashboard mobile */
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .quick-action-grid { grid-template-columns: 1fr; }
  .add-folder-row { flex-direction: column; }
  .add-folder-row .form-input { min-width: 0; }
  /* Scroll tables horizontally */
  .table-responsive { -webkit-overflow-scrolling: touch; }
  /* Hide less important columns */
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
}

/* Improve touch targets on mobile globally */
@media (max-width: 767px) {
  .btn { min-height: 46px; }
  .form-input { min-height: 46px; font-size: 16px; } /* 16px prevents iOS zoom */
  .nav-link { min-height: 48px; }
  .selfie-tab { min-height: 44px; }
  .modal-close { width: 48px; height: 48px; top: 12px; right: 12px; }
}



/* ─────────────────────────────────────────────────────────────────────────────
   NOTIFICATION BELL + DROPDOWN
   ───────────────────────────────────────────────────────────────────────────── */

/* Bell button */
.notif-bell-wrap { position: relative; }

.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  min-width: 40px;
  min-height: 40px;
}
.notif-bell-btn:hover { background: var(--bg3); color: var(--text); }
.notif-bell-btn.has-unread { color: var(--accent2); }
.notif-bell-btn.has-unread svg {
  animation: bell-ring 0.6s ease-in-out;
  transform-origin: top center;
}

@keyframes bell-ring {
  0%, 100% { transform: rotate(0deg); }
  20%       { transform: rotate(15deg); }
  40%       { transform: rotate(-15deg); }
  60%       { transform: rotate(10deg); }
  80%       { transform: rotate(-10deg); }
}

/* Red badge */
.notif-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 10px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border: 2px solid var(--bg);
  line-height: 1;
}

/* Mobile badge in nav list */
.notif-badge-mobile {
  background: #ef4444;
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
}

/* Dropdown panel */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 20px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
  animation: dropdown-in .18s ease;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.notif-dropdown-title { font-size: .875rem; font-weight: 600; color: var(--text); }
.notif-text-btn {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .15s;
}
.notif-text-btn:hover { background: rgba(108,99,255,0.1); }

.notif-dropdown-list { max-height: 360px; overflow-y: auto; }
.notif-empty-msg { padding: 2rem; text-align: center; color: var(--text2); font-size: .875rem; }

/* Individual item in dropdown */
.notif-drop-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: default;
}
.notif-drop-item:last-child { border-bottom: none; }
.notif-drop-unread { background: rgba(108,99,255,0.06); }
.notif-drop-item:hover { background: var(--bg3); }

.notif-drop-icon { font-size: 1.3rem; flex-shrink: 0; padding-top: 2px; }
.notif-drop-body { flex: 1; min-width: 0; }
.notif-drop-title { font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: 2px; line-height: 1.4; }
.notif-drop-msg   { font-size: .78rem; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-drop-time  { font-size: .72rem; color: var(--text3); margin-top: 4px; }

/* Small unread dot button */
.notif-read-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent2);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 6px;
  transition: transform .2s;
}
.notif-read-dot:hover { transform: scale(1.4); background: var(--success); }

/* avatar as link */
.avatar-link { display: flex; align-items: center; text-decoration: none; }
.avatar-img { object-fit: cover; border-radius: 50%; border: 2px solid var(--accent); }

/* ─── Notification Inbox Page ─────────────────────────────────────────────── */
.notif-inbox-icon { font-size: 1.3rem; }

.notif-list { display: flex; flex-direction: column; gap: 8px; }

.notif-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
}
.notif-unread { background: rgba(108,99,255,0.06); border-color: rgba(108,99,255,0.25); }
.notif-unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent2);
  border-radius: 3px 0 0 3px;
}

.notif-icon-col { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 2px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.notif-dot-active { background: var(--accent2); box-shadow: 0 0 6px rgba(108,99,255,0.6); }
.notif-type-icon { font-size: 1.4rem; }

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.notif-msg   { font-size: .83rem; color: var(--text2); line-height: 1.6; }
.notif-time  { font-size: .75rem; color: var(--text3); margin-top: 6px; }

.notif-read-form { flex-shrink: 0; }
.notif-read-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .78rem;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}
.notif-read-btn:hover { background: var(--success); border-color: var(--success); color: white; }

