/* ═══════════════════════════════════════════════════════════════
   iMark — Certfile Style
   Dark:  deep purple bg · teal-cyan accent · glowing cards
   Light: soft lavender-gray · purple+pink gradients · white cards
   Font:  Outfit (headings) · Plus Jakarta Sans (body)
═══════════════════════════════════════════════════════════════ */

/* ── Dark Theme (default) ── */
:root {
  --bg:           #130a2a;
  --bg-2:         #1a0f38;
  --surface:      #1f1242;
  --surface-2:    #2a1a55;
  --border:       #3d2a6e;
  --border-soft:  #2e1f55;

  --text:         #f0eaff;
  --text-muted:   #9d8dc0;
  --text-faint:   #5a4880;

  --accent:       #00d4b8;
  --accent-dim:   rgba(0,212,184,.15);
  --accent-dark:  #00b09c;

  --grad-start:   #7c3aed;
  --grad-end:     #ec4899;
  --gradient:     linear-gradient(135deg, #7c3aed, #ec4899);
  --gradient-btn: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);

  --pin-bg:       #ec4899;
  --pin-resolve:  #00d4b8;

  --danger:       #ff5c8a;
  --warn:         #f0a500;

  --canvas-bg:    #0d0720;
  --canvas:       #ffffff;

  --card-glow:    0 0 30px rgba(124,58,237,.18), 0 4px 24px rgba(0,0,0,.4);
  --card-glow-h:  0 0 40px rgba(124,58,237,.3),  0 8px 32px rgba(0,0,0,.5);

  --radius:       16px;
  --radius-lg:    22px;
  --radius-sm:    10px;
  --radius-pill:  999px;

  --sidebar-w:    340px;
  --topbar-h:     60px;

  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg:           #eceaf5;
  --bg-2:         #e4e1f0;
  --surface:      #ffffff;
  --surface-2:    #f3f0fc;
  --border:       #ddd8f0;
  --border-soft:  #ede9fa;

  --text:         #1a0b2e;
  --text-muted:   #6b5b8d;
  --text-faint:   #b0a4cc;

  --accent:       #7c3aed;
  --accent-dim:   rgba(124,58,237,.1);
  --accent-dark:  #6d28d9;

  --pin-bg:       #ec4899;
  --pin-resolve:  #7c3aed;

  --danger:       #e11d48;
  --warn:         #d97706;

  --canvas-bg:    #f0edf8;
  --canvas:       #ffffff;

  --card-glow:    0 2px 20px rgba(124,58,237,.08), 0 1px 4px rgba(0,0,0,.06);
  --card-glow-h:  0 8px 40px rgba(124,58,237,.18), 0 2px 8px rgba(0,0,0,.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
img { display: block; max-width: 100%; }
input, textarea, button { font-family: inherit; font-size: inherit; }
a { text-decoration: none; color: inherit; }
svg { display: block; width: 16px; height: 16px; fill: none;
      stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }

/* ── Smooth theme transition ── */
body, .sidebar, .project-card, .modal, .comment-item,
.comment-sidebar, .viewer-topbar, input, textarea {
  transition: background-color .3s, border-color .3s, color .2s, box-shadow .3s;
}

/* ═══ THEME TOGGLE ══════════════════════════════════════════════ */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(25deg) scale(1.05);
}
.theme-toggle svg { width: 17px; height: 17px; }

/* ═══ BRAND ═════════════════════════════════════════════════════ */
.brand-logo {
  width: 34px; height: 34px;
  background: var(--gradient);
  border-radius: 10px;
  position: relative;
  box-shadow: 0 4px 14px rgba(124,58,237,.4);
  flex-shrink: 0;
}
.brand-logo::after {
  content: '';
  position: absolute; inset: 8px;
  border: 2.5px solid rgba(255,255,255,.5);
  border-radius: 3px;
}
.brand-logo.small { width: 26px; height: 26px; border-radius: 8px; }
.brand-logo.small::after { inset: 6px; border-width: 2px; }

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800; font-size: 20px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* ═══ AUTH PAGES ════════════════════════════════════════════════ */
.auth-page {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  position: relative; overflow: hidden;
}
.auth-page::before, .auth-page::after {
  content: ''; position: fixed;
  border-radius: 50%; pointer-events: none; z-index: 0;
}
.auth-page::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,.25) 0%, transparent 70%);
  top: -150px; right: -100px;
}
.auth-page::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(236,72,153,.2) 0%, transparent 70%);
  bottom: -100px; left: -80px;
}

.auth-container {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%; max-width: 430px;
  box-shadow: var(--card-glow);
  position: relative; z-index: 1;
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 36px;
}
.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--text); margin-bottom: 6px; letter-spacing: -0.5px;
}
.auth-sub { color: var(--text-muted); margin-bottom: 30px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-switch {
  text-align: center; color: var(--text-muted);
  margin-top: 22px; font-size: 13px;
}
.auth-switch a {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; font-weight: 700;
}
.auth-top-right { position: absolute; top: 20px; right: 20px; z-index: 2; }

/* ═══ FORM FIELDS ═══════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-weight: 700; color: var(--text-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .8px;
  font-family: 'Outfit', sans-serif;
}
input[type="text"], input[type="email"], input[type="url"],
input[type="password"], textarea {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px; color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s; width: 100%;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 80px; }

/* ═══ BUTTONS ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: var(--radius-pill);
  font-weight: 700; cursor: pointer; border: none; outline: none;
  transition: all .2s; white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--gradient-btn); color: #fff;
  box-shadow: 0 4px 18px rgba(124,58,237,.4);
}
.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(124,58,237,.55);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border); color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim); transform: translateY(-1px);
}

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid transparent; }
.btn-danger:hover { background: rgba(255,92,138,.1); border-color: var(--danger); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-full { width: 100%; justify-content: center; }

.btn-logout {
  display: block; text-align: center;
  padding: 9px; border-radius: var(--radius-pill);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  transition: all .2s; border: 1.5px solid transparent;
  font-family: 'Outfit', sans-serif;
  background: var(--bg-2);
  border: solid 1px var(--border);
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); background: rgba(255,92,138,.08); }

/* ═══ ALERT ═════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-weight: 600; font-size: 13px; border: 1.5px solid;
}
.alert-error { background: rgba(255,92,138,.1); color: var(--danger); border-color: rgba(255,92,138,.3); }

/* ═══ DASHBOARD ═════════════════════════════════════════════════ */
.dashboard-page { background: var(--bg); display: flex; height: 100vh; overflow: hidden; }
.dashboard-page::before {
  content: ''; position: fixed;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 70%);
  top: -200px; right: -100px; pointer-events: none; z-index: 0;
}

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 0;
  position: relative; z-index: 1;
}
.sidebar-top { flex: 1; padding: 0 16px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px; margin-bottom: 28px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; border-radius: var(--radius-pill);
  color: var(--text-muted); font-weight: 600; transition: all .2s;
}
.nav-link svg { width: 17px; height: 17px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(3px); }
.nav-link.active { background: var(--accent-dim); color: var(--accent); }

.nav-link-admin {
  margin-top: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
}
.nav-link-admin:hover {
  border-color: #ec4899 !important;
  color: #ec4899 !important;
  background: rgba(236,72,153,.08) !important;
  transform: translateX(3px);
}

.sidebar-bottom { padding: 16px; border-top: 1px solid var(--border-soft); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(124,58,237,.4);
  font-family: 'Outfit', sans-serif;
}
.user-name  { font-weight: 700; font-size: 13px; }
.user-email { color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 145px; }

.main-content { flex: 1; overflow-y: auto; padding: 36px 40px; position: relative; z-index: 1; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.page-header-left { display: flex; flex-direction: column; gap: 4px; }
.page-header-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.page-sub { color: var(--text-muted); font-size: 13px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--surface); border: 1.5px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--card-glow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-glow-h);
  border-color: var(--border);
}

.project-thumb {
  height: 164px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb svg { width: 52px; height: 52px; color: var(--text-faint); }

/* PDF / website thumbnail canvas & loading state */
.pdf-thumb-canvas {
  width: 100%; height: 100%;
  object-fit: cover; display: none;
}
.pdf-thumb-canvas.loaded { display: block; }

.website-thumb-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.thumb-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.thumb-loading svg { width: 40px; height: 40px; color: var(--text-faint); opacity: .6; }
.thumb-loading.hidden { display: none; }
.pdf-thumb     { background: linear-gradient(135deg, #1a0f38 0%, #2d1155 100%); }
.website-thumb { background: linear-gradient(135deg, #0f1a38 0%, #11275a 100%); }
[data-theme="light"] .pdf-thumb     { background: linear-gradient(135deg, #f5f0ff, #ede0ff); }
[data-theme="light"] .website-thumb { background: linear-gradient(135deg, #eef5ff, #ddeeff); }

.project-info { padding: 18px; }
.type-badge {
  display: inline-block; padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; margin-bottom: 10px;
  font-family: 'Outfit', sans-serif;
}
.type-image   { background: rgba(0,212,184,.15);  color: #00d4b8; }
.type-pdf     { background: rgba(240,165,0,.15);   color: var(--warn); }
.type-website { background: rgba(167,139,250,.2);  color: #a78bfa; }
[data-theme="light"] .type-image   { background: rgba(0,180,160,.12); color: #00897b; }
[data-theme="light"] .type-website { background: rgba(124,58,237,.12); color: #7c3aed; }

.project-title {
  font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700;
  margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-meta { display: flex; gap: 14px; margin-bottom: 16px; }
.meta-item { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 12px; }
.meta-item svg { width: 12px; height: 12px; }
.project-actions { display: flex; align-items: center; gap: 8px; }
.project-actions .btn-danger { margin-left: auto; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  height: calc(100vh - 200px); color: var(--text-muted);
}
.empty-icon {
  width: 80px; height: 80px; border-radius: 24px;
  background: var(--surface); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px; box-shadow: var(--card-glow);
}
.empty-icon svg { width: 36px; height: 36px; color: var(--text-faint); }
.empty-state h2 { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.empty-state p { max-width: 320px; margin-bottom: 26px; line-height: 1.6; }

/* ═══ MODAL ═════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,5,25,.8); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 510px;
  box-shadow: var(--card-glow-h);
  animation: slideUp .22s cubic-bezier(.34,1.56,.64,1);
}
.modal-sm { max-width: 390px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px; border-bottom: 1px solid var(--border-soft);
}
.modal-header h2 { font-family: 'Outfit', sans-serif; font-size: 19px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; padding: 0;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); transform: rotate(90deg); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body   { padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px; border-top: 1px solid var(--border-soft); }

.type-selector { display: flex; gap: 10px; }
.type-btn {
  flex: 1; padding: 14px 8px;
  background: var(--bg-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; font-family: 'Outfit', sans-serif;
  transition: all .2s;
}
.type-btn svg { width: 22px; height: 22px; }
.type-btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.type-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 20px var(--accent-dim); }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 36px 20px; text-align: center; cursor: pointer;
  transition: all .2s; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.drop-zone svg { width: 36px; height: 36px; color: var(--text-faint); margin-bottom: 4px; }
.drop-zone p { color: var(--text-muted); }
.drop-zone span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }
.drop-zone small { color: var(--text-faint); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-dim); transform: scale(1.01); }

.file-selected { background: var(--accent-dim); border: 1.5px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 16px; font-size: 13px; color: var(--accent); font-weight: 600; }
.progress-bar { height: 5px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--gradient); width: 0%; transition: width .2s; border-radius: var(--radius-pill); }
#progressText { color: var(--text-muted); font-size: 13px; text-align: center; }

/* ═══ VIEWER ════════════════════════════════════════════════════ */
.viewer-page { background: var(--bg); height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.viewer-layout { display: flex; flex-direction: column; height: 100%; }

.viewer-topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; gap: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.2);
}
.topbar-left  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.back-btn {
  width: 36px; height: 36px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all .2s; flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.back-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent); transform: translateX(-2px); }
.back-btn svg { width: 18px; height: 18px; }

.viewer-title { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-body  { flex: 1; display: flex; overflow: hidden; }

.content-area { flex: 1; overflow: auto; background: var(--canvas-bg); display: flex; justify-content: center; padding: 36px; }
.content-area.website-mode { padding: 0; overflow: hidden; }
.content-area.website-mode.vp-resized { padding: 24px; overflow: auto; background: var(--canvas-bg); }
.content-wrapper { position: relative; display: inline-block; align-self: flex-start; box-shadow: 0 12px 60px rgba(0,0,0,.3); border-radius: 8px; }
.content-wrapper img { display: block; max-width: 100%; border-radius: 8px; }

.pdf-wrapper { position: relative; align-self: flex-start; display: flex; flex-direction: column; gap: 24px; }
.pdf-page-container { position: relative; box-shadow: 0 6px 30px rgba(0,0,0,.2); border-radius: 4px; }
.pdf-page-container canvas { display: block; border-radius: 4px; }
.pdf-page-overlay { position: absolute; inset: 0; cursor: crosshair; z-index: 5; }
.mainImage { border: solid 1px #b7a3e573; border-radius: 4px; padding: 2px; }
.website-wrapper { position: relative; width: 100%; height: 100%; transition: width .3s ease, height .3s ease; margin: 0 auto; }
.website-wrapper.vp-tablet  { width: 768px; box-shadow: 0 0 40px rgba(0,0,0,.25); border-radius: 8px; overflow: hidden; }
.website-wrapper.vp-mobile  { width: 375px; box-shadow: 0 0 40px rgba(0,0,0,.25); border-radius: 8px; overflow: hidden; }
#siteFrame { width: 100%; height: 100%; border: none; display: block; background: #ffffff; }

/* ── Viewport Toggle ─────────────────────── */
.viewport-toggle {
  display: inline-flex; gap: 2px;
  background: var(--surface-2); border-radius: var(--radius);
  padding: 3px; border: 1px solid var(--border-soft);
}
.vp-btn {
  width: 34px; height: 34px; border: none; background: none; cursor: pointer;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all .18s;
}
.vp-btn svg { width: 18px; height: 18px; }
.vp-btn:hover { color: var(--text); background: var(--surface); }
.vp-btn.active {
  background: var(--gradient-btn); color: white;
  box-shadow: 0 2px 8px rgba(124,58,237,.35);
}
.browse-hint {
  position: sticky; top: 8px;
  background: rgba(19,10,42,.88); backdrop-filter: blur(8px);
  color: var(--text-muted); font-size: 12px; font-weight: 700;
  padding: 6px 18px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  display: inline-block; margin: 12px auto; left: 50%; transform: translateX(-50%);
  pointer-events: none; z-index: 20; white-space: nowrap; font-family: 'Outfit', sans-serif;
}

.click-overlay { position: absolute; inset: 0; cursor: crosshair; z-index: 10; }
.click-overlay:not(.active) { pointer-events: none; }
.pins-layer { position: absolute; inset: 0; pointer-events: none; z-index: 15; }

.comment-pin {
  position: absolute;
  width: 30px; height: 30px; border-radius: 50% 50% 50% 6px;
  background: var(--gradient-btn); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; font-family: 'Outfit', sans-serif;
  transform: translate(-15px, -30px);
  pointer-events: all; cursor: pointer;
  box-shadow: 0 4px 16px rgba(236,72,153,.45);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  border: 2px solid rgba(255,255,255,.2);
  user-select: none; z-index: 20;
}
.comment-pin:hover { transform: translate(-15px, -38px) scale(1.15); box-shadow: 0 10px 28px rgba(236,72,153,.6); }
.comment-pin.resolved { background: linear-gradient(135deg, #00d4b8, #00b09c); box-shadow: 0 4px 14px rgba(0,212,184,.4); }
.comment-pin.active   { box-shadow: 0 0 0 3px white, 0 8px 28px rgba(124,58,237,.55); transform: translate(-15px, -36px) scale(1.1); }

/* ═══ COMMENT SIDEBAR ═══════════════════════════════════════════ */
.comment-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-left: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  transition: width .25s cubic-bezier(.4,0,.2,1);
}
.comment-sidebar.collapsed { width: 50px; overflow: hidden; }

/* Top row: brand label + collapse toggle */
.sidebar-top-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0; min-width: 0;
}
.sidebar-brand-label {
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s, width .2s;
}
.collapsed .sidebar-brand-label {
  opacity: 0; width: 0; pointer-events: none;
}
.sidebar-toggle {
  width: 30px; height: 30px; border: none; background: none;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); transition: all .2s; padding: 0;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--surface-2); color: var(--text); }
.sidebar-toggle svg { width: 14px; height: 14px; transition: transform .25s; }
.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

/* Hide tabs and panels when collapsed */
.collapsed .sidebar-tabs,
.collapsed .sidebar-subtabs,
.collapsed .sidebar-panel {
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.sidebar-tabs,
.sidebar-subtabs,
.sidebar-panel {
  transition: opacity .2s;
}

/* Main tabs: Feedback / Activity */
.sidebar-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0; padding: 0 4px;
}
.sidebar-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 8px; background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted); font-weight: 700; font-size: 13px;
  font-family: 'Outfit', sans-serif; cursor: pointer;
  transition: all .18s; margin-bottom: -1px;
}
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-count {
  background: var(--gradient); color: white;
  font-size: 10px; font-weight: 800; font-family: 'Outfit', sans-serif;
  padding: 1px 7px; border-radius: var(--radius-pill);
  min-width: 18px; text-align: center;
}

/* Sub-tabs: Active / Resolved */
.sidebar-subtabs {
  display: flex; gap: 6px;
  padding: 10px 14px 0; flex-shrink: 0;
}
.sidebar-subtab {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 14px; background: var(--surface-2);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--text-muted); font-weight: 700; font-size: 12px;
  font-family: 'Outfit', sans-serif; cursor: pointer;
  transition: all .18s;
}
.sidebar-subtab:hover { border-color: var(--border); color: var(--text); }
.sidebar-subtab.active {
  background: var(--accent-dim);
  border-color: var(--accent); color: var(--accent);
}
.subtab-count {
  font-size: 10px; font-weight: 800;
  background: var(--surface); border-radius: var(--radius-pill);
  padding: 0 5px; color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
}
.sidebar-subtab.active .subtab-count { color: var(--accent); }

/* Panels */
.sidebar-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.sidebar-panel[hidden] { display: none !important; }

.comment-list { flex: 1; overflow-y: auto; padding: 12px 14px; }
.comment-list[hidden] { display: none !important; }

.comments-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; height: 200px; color: var(--text-faint); gap: 12px; padding: 20px;
}
.comments-empty svg { width: 32px; height: 32px; }
.comments-empty p { font-size: 13px; line-height: 1.6; color: var(--text-muted); }

/* Comment item */
.comment-item {
  background: var(--surface-2); border: 1.5px solid var(--border-soft);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 8px;
  transition: all .2s; cursor: pointer;
  animation: fadeIn .22s ease;
}
.comment-item:hover { border-color: var(--border); transform: translateX(-2px); box-shadow: var(--card-glow); }
.comment-item.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.comment-item.resolved { opacity: .6; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.ci-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ci-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gradient-btn); color: white;
  font-size: 10px; font-weight: 800; font-family: 'Outfit', sans-serif;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ci-num.resolved { background: linear-gradient(135deg, #00d4b8, #00b09c); }
.ci-author { font-weight: 700; font-size: 13px; flex: 1; }
.ci-time   { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.ci-new-badge {
  background: var(--gradient-btn); color: white;
  font-size: 9px; font-weight: 800; font-family: 'Outfit', sans-serif;
  padding: 1px 7px; border-radius: var(--radius-pill); letter-spacing: .3px;
}
.ci-content { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin-bottom: 10px; }

.ci-actions { display: flex; gap: 6px; }
.ci-action {
  font-size: 11px; font-weight: 700; font-family: 'Outfit', sans-serif;
  padding: 3px 12px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: none; cursor: pointer;
  color: var(--text-muted); transition: all .18s;
}
.ci-action:hover { background: var(--surface); color: var(--text); }
.ci-action.resolve-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.ci-action.delete-btn:hover  { border-color: var(--danger); color: var(--danger); background: rgba(255,92,138,.08); }

/* ── Device indicator on comments ─── */
.ci-device {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--text-faint); font-size: 10px; font-weight: 600;
  margin-left: auto;
}
.ci-device svg { width: 13px; height: 13px; opacity: .6; }

/* ── Screenshot thumbnail ─── */
.ci-screenshot {
  margin: 6px 0 8px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border-soft); cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  max-height: 120px;
}
.ci-screenshot:hover { transform: scale(1.02); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.ci-screenshot img {
  display: block; width: 100%; height: auto;
  object-fit: cover; border-radius: 5px;
}

/* Screenshot lightbox */
.screenshot-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; animation: fadeIn .2s;
}
.screenshot-lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* Activity items */
.activity-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
  animation: fadeIn .22s ease;
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; font-family: 'Outfit', sans-serif;
}
.activity-avatar.resolve { background: linear-gradient(135deg, #00d4b8, #00b09c); }
.activity-avatar.delete  { background: linear-gradient(135deg, #ff5c8a, #c9184a); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.activity-text strong { color: var(--text); font-weight: 700; }
.activity-excerpt {
  margin-top: 4px; font-size: 12px; color: var(--text-faint);
  font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-time { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* ═══ COMMENT POPUP ═════════════════════════════════════════════ */
.comment-popup {
  position: fixed; z-index: 200;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px; width: 290px;
  box-shadow: var(--card-glow-h);
  animation: slideUp .18s cubic-bezier(.34,1.56,.64,1);
}
.comment-popup[hidden] { display: none !important; }
.popup-input, .popup-textarea {
  background: var(--surface-2) !important; border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important; padding: 9px 13px !important;
  color: var(--text) !important; width: 100%;
}
.popup-textarea { resize: none; min-height: 72px; }
.popup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ═══ TOAST ═════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-pill); padding: 12px 26px;
  font-size: 13px; font-weight: 700; font-family: 'Outfit', sans-serif;
  box-shadow: var(--card-glow); z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; white-space: nowrap;
}
.toast.show { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error   { border-color: var(--danger); color: var(--danger); }

/* ═══ WORKSPACE SWITCHER ════════════════════════════════════════ */
.ws-switcher { position: relative; margin-bottom: 20px; }

.ws-current {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; border: 1.5px solid var(--border-soft);
  background: var(--surface-2); transition: all .2s;
}
.ws-current:hover { border-color: var(--border); }
.ws-current.no-toggle { cursor: default; }

.ws-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
  font-family: 'Outfit', sans-serif;
}
.ws-icon.sm  { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
.ws-icon.lg  { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; }

.ws-info { flex: 1; min-width: 0; }
.ws-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-role { font-size: 11px; color: var(--text-muted); }

.ws-caret { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); transition: transform .2s; }

.ws-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--card-glow-h);
  z-index: 100; overflow: hidden;
  animation: slideUp .15s ease;
}
.ws-dropdown[hidden] { display: none !important; }

.ws-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background .15s;
  font-size: 13px; font-weight: 600;
}
.ws-option:hover { background: var(--surface-2); }
.ws-option.active { background: var(--accent-dim); }
.ws-option svg { width: 14px; height: 14px; }

.ws-divider { height: 1px; background: var(--border-soft); margin: 4px 0; }

.ws-create-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 13px; font-weight: 700;
  font-family: 'Outfit', sans-serif; transition: background .15s;
}
.ws-create-btn svg { width: 14px; height: 14px; }
.ws-create-btn:hover { background: var(--accent-dim); }

/* ═══ COLOR SWATCHES ════════════════════════════════════════════ */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid transparent; cursor: pointer;
  transition: all .18s; outline: none;
}
.color-swatch:hover  { transform: scale(1.15); }
.color-swatch.active { border-color: white; box-shadow: 0 0 0 2px var(--accent); }

/* ═══ FILTERS BAR ════════════════════════════════════════════════ */
.filters-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.filter-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  font-family: 'Outfit', sans-serif; margin-right: 4px;
}
.filter-label svg { width: 13px; height: 13px; }

.filter-dropdown { position: relative; }
.filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  font-family: 'Outfit', sans-serif; cursor: pointer; transition: all .18s;
}
.filter-btn svg { width: 13px; height: 13px; }
.filter-btn .caret { width: 11px; height: 11px; }
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.has-value { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.filter-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); min-width: 160px;
  box-shadow: var(--card-glow-h); z-index: 200;
  overflow: hidden; animation: slideUp .15s ease;
}
.filter-menu[hidden] { display: none !important; }

.filter-option {
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: space-between;
}
.filter-option:hover { background: var(--surface-2); }
.filter-option.active {
  color: var(--accent); font-weight: 700;
  background: var(--accent-dim);
}
.filter-option.active::after {
  content: '✓'; font-size: 12px;
}

.filter-clear {
  padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--danger); background: none;
  color: var(--danger); font-size: 12px; font-weight: 700;
  font-family: 'Outfit', sans-serif; cursor: pointer; transition: all .18s;
  margin-left: 4px;
}
.filter-clear:hover { background: rgba(255,92,138,.1); }
.filter-clear[hidden] { display: none !important; }

/* ═══ ARCHIVED CARD ══════════════════════════════════════════════ */
.archived-card { opacity: .85; }
.archived-card:hover { opacity: 1; }
.archived-banner {
  position: absolute; top: 10px; left: 10px;
  background: rgba(240,165,0,.2); color: var(--warn);
  border: 1px solid rgba(240,165,0,.3);
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-family: 'Outfit', sans-serif; z-index: 5;
}

/* ═══ SETTINGS PAGE ══════════════════════════════════════════════ */
.settings-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border-soft);
  margin-bottom: 32px;
}
.settings-tab {
  padding: 11px 20px; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--text-muted); font-size: 14px; font-weight: 700;
  font-family: 'Outfit', sans-serif; cursor: pointer; transition: all .18s;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--text); border-bottom-color: var(--accent); }

.settings-body { max-width: 700px; }

.settings-section {
  background: var(--surface); border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 28px;
  margin-bottom: 24px; box-shadow: var(--card-glow);
}
.settings-section.danger-zone { border-color: rgba(255,92,138,.3); }

.settings-section-title {
  font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 800;
  margin-bottom: 24px;
}

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border-soft);
}
.settings-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-row:first-of-type { padding-top: 0; }

.settings-row-label { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.settings-row-control { display: flex; align-items: center; gap: 10px; }
.settings-row-control input {
  width: 260px; background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text);
}

/* Alert success */
.alert-success {
  background: rgba(0,212,184,.1); color: var(--accent);
  border: 1.5px solid rgba(0,212,184,.3);
}

/* ═══ TEAM / MEMBERS ════════════════════════════════════════════ */
.members-list { display: flex; flex-direction: column; gap: 2px; }

.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-soft);
  animation: fadeIn .2s ease;
}
.member-row:last-child { border-bottom: none; }

.member-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; font-family: 'Outfit', sans-serif;
}

.member-info { flex: 1; min-width: 0; }
.member-name  { font-weight: 700; font-size: 13px; }
.member-email { font-size: 11px; color: var(--text-muted); }

.member-badges { display: flex; gap: 6px; align-items: center; }

.role-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; padding: 2px 9px;
  border-radius: var(--radius-pill); font-family: 'Outfit', sans-serif;
}
.role-owner  { background: var(--accent-dim); color: var(--accent); }
.role-member { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.status-badge {
  font-size: 10px; font-weight: 700; padding: 2px 9px;
  border-radius: var(--radius-pill); font-family: 'Outfit', sans-serif;
}
.status-badge.pending { background: rgba(240,165,0,.15); color: var(--warn); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

