/* ─────────────────────────────────────────────────────────
   LabelFlow — Design System
   Supports dark (default) + light theme via [data-theme="light"]
───────────────────────────────────────────────────────── */

/* ── Dark theme (default) ───────────────────────────────── */
:root {
  --bg:             #09090e;
  --surface:        #0f0f17;
  --surface2:       #161621;
  --surface3:       #1e1e2e;
  --border:         rgba(255,255,255,0.06);
  --border-hover:   rgba(255,255,255,0.1);
  --border-accent:  rgba(99,102,241,0.35);

  --text:           #e2e2f0;
  --text-muted:     #6b6b88;
  --text-dim:       #2e2e42;

  --accent:         #6366f1;
  --accent-bright:  #818cf8;
  --accent-dim:     #3730a3;
  --accent-glow:    rgba(99,102,241,0.12);

  --success:        #34d399;
  --warning:        #fbbf24;
  --danger:         #f87171;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow:     0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6);

  --font-mono: 'DM Mono', monospace;
}

/* ── Light theme ────────────────────────────────────────── */
[data-theme="light"] {
  --bg:             #f4f4f8;
  --surface:        #ffffff;
  --surface2:       #f0f0f5;
  --surface3:       #e6e6ef;
  --border:         rgba(0,0,0,0.08);
  --border-hover:   rgba(0,0,0,0.14);
  --border-accent:  rgba(99,102,241,0.3);

  --text:           #1a1a2e;
  --text-muted:     #6b6b88;
  --text-dim:       #c0c0d0;

  --accent:         #6366f1;
  --accent-bright:  #4f52d8;
  --accent-dim:     #c7c8fa;
  --accent-glow:    rgba(99,102,241,0.08);

  --success:        #059669;
  --warning:        #d97706;
  --danger:         #dc2626;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.15);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}

h1, h2, h3, h4, h5 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow: visible;
  padding-bottom: 2px;
}

code, kbd, .mono { font-family: 'DM Mono', monospace; }

a { color: var(--accent-bright); text-decoration: none; transition: color .15s; }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border-hover);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface2);
  color: var(--text);
}

.btn-danger {
  background: rgba(248,113,113,.1);
  color: var(--danger);
  border-color: rgba(248,113,113,.25);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248,113,113,.2);
  border-color: var(--danger);
}

.btn-success {
  background: rgba(52,211,153,.1);
  color: var(--success);
  border-color: rgba(52,211,153,.25);
}
.btn-success:hover:not(:disabled) {
  background: rgba(52,211,153,.2);
  border-color: var(--success);
}

.btn-sm   { padding: 6px 13px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg   { padding: 13px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-icon { padding: 8px; justify-content: center; }
.btn-full { width: 100%; justify-content: center; }

/* ── Dropdown ───────────────────────────────────────────── */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--surface2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  z-index: 200;
  padding: 4px 0;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--accent-glow); color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.field-errors { color: var(--danger); font-size: 13px; margin-top: 4px; }
.field-errors li { list-style: none; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: border-color .2s;
}
.card:hover { border-color: var(--border-hover); }
.card-flat  { padding: 0; overflow: hidden; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.badge-accent   { background: var(--accent-glow);            color: var(--accent-bright); border-color: var(--border-accent); }
.badge-success  { background: rgba(52,211,153,.1);           color: var(--success);       border-color: rgba(52,211,153,.25); }
.badge-warning  { background: rgba(251,191,36,.1);           color: var(--warning);       border-color: rgba(251,191,36,.25); }
.badge-danger   { background: rgba(248,113,113,.1);          color: var(--danger);        border-color: rgba(248,113,113,.25); }
.badge-muted    { background: var(--surface3);               color: var(--text-muted);    border-color: var(--border); }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success  { background: rgba(52,211,153,.08);  color: var(--success); border-color: rgba(52,211,153,.25); }
.alert-error,
.alert-danger   { background: rgba(248,113,113,.08); color: var(--danger);  border-color: rgba(248,113,113,.25); }
.alert-warning  { background: rgba(251,191,36,.08);  color: var(--warning); border-color: rgba(251,191,36,.25); }
.alert-info     { background: var(--accent-glow);    color: var(--accent-bright); border-color: var(--border-accent); }

/* ── Dividers ───────────────────────────────────────────── */
hr, .divider { border: none; border-top: 1px solid var(--border); margin: 22px 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;
  min-width: 240px;
  max-width: 380px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-success { border-color: rgba(52,211,153,.4); }
.toast-success .toast-icon { color: var(--success); }
.toast-error   { border-color: rgba(248,113,113,.4); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-info    { border-color: var(--border-accent); }
.toast-info    .toast-icon { color: var(--accent-bright); }

/* ── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 32px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 16px; opacity: .35; }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* ── Avatar ─────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  user-select: none;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; border-radius: 6px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; border-radius: 8px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; border-radius: 16px; }
.avatar-c0 { background: linear-gradient(135deg,#6366f1,#818cf8); }
.avatar-c1 { background: linear-gradient(135deg,#34d399,#059669); }
.avatar-c2 { background: linear-gradient(135deg,#f59e0b,#d97706); }
.avatar-c3 { background: linear-gradient(135deg,#f87171,#dc2626); }
.avatar-c4 { background: linear-gradient(135deg,#a78bfa,#7c3aed); }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  transform: translateY(16px) scale(.98);
  transition: transform .2s;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-header h2 { font-size: 18px; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: all .15s;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Status indicators ──────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.pending { background: var(--text-dim); }
.status-dot.partial { background: var(--warning); }
.status-dot.done    { background: var(--success); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeUp  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.fade-up { animation: fadeUp .35s ease forwards; }
.fade-in { animation: fadeIn .3s ease forwards; }

.stagger > * { opacity: 0; animation: fadeUp .3s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .16s; }
.stagger > *:nth-child(5) { animation-delay: .20s; }
.stagger > *:nth-child(6) { animation-delay: .24s; }

/* ── Utilities ──────────────────────────────────────────── */
.flex            { display: flex; }
.flex-col        { display: flex; flex-direction: column; }
.flex-spacer     { flex: 1; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-2   { margin-top: 8px; }
.mt-4   { margin-top: 16px; }
.mb-4   { margin-bottom: 16px; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.font-mono   { font-family: 'DM Mono', monospace; }
.w-full      { width: 100%; }
.truncate    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Page layout helpers ────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-title h1 { font-size: 24px; margin-bottom: 3px; }
.page-title p  { color: var(--text-muted); font-size: 14px; }
.page-actions  { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 15px; }

/* ── Workspace switcher ─────────────────────────────────── */
.workspace-switcher { padding: 4px 8px; }
.workspace-select { width: 100%; padding: 6px 8px; font-size: 13px; border-radius: 6px; }

/* ── Logout form ────────────────────────────────────────── */
.logout-form { margin: 4px 8px 0; }
.nav-item-btn { width: 100%; background: none; border: none; cursor: pointer; text-align: left; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }


/* ════════════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════════ */

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* Backdrop is desktop-invisible; only shown on mobile via media query */
.sidebar-backdrop { display: none; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.sidebar-logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.035em;
  color: var(--text);
  line-height: 1.4;
  overflow: visible;
  padding-bottom: 2px;
}
.sidebar-logo-text em { color: var(--accent-bright); font-style: italic; }

.nav-section { padding: 8px 8px 4px; flex: 1; }

.nav-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  padding: 10px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all .12s;
  position: relative;
  margin-bottom: 1px;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent-bright); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 55%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-count {
  margin-left: auto;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.nav-item.active .nav-count { background: var(--accent-glow); color: var(--accent-bright); border-color: var(--border-accent); }

/* ── Theme toggle button ────────────────────────────────── */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: calc(100% - 16px);
  margin: 0 8px 6px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-hover);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
}
.theme-toggle-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-bright);
}
.theme-toggle-btn .theme-icon { font-size: 15px; }
.theme-toggle-btn .theme-label { flex: 1; }

/* ── Sidebar bottom ─────────────────────────────────────── */
.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: 10px 8px 12px;
}
.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .12s;
  cursor: pointer;
}
.user-item:hover { background: var(--surface2); }
.user-info  { min-width: 0; flex: 1; }
.user-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role  { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }

/* ── Toolbar ────────────────────────────────────────────── */
.toolbar {
  grid-column: 2;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.toolbar-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  overflow: visible;
}
.toolbar-search         { position: relative; width: 220px; }
.toolbar-search input   { padding-left: 32px; height: 32px; font-size: 13px; }
.toolbar-search-icon    { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }
.toolbar-sep            { width: 1px; height: 22px; background: var(--border); }

/* ── Notification bell ──────────────────────────────────── */
.notification-bell { position: relative; }
.notification-bell-btn {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px; color: var(--text); cursor: pointer;
  font-size: 15px; transition: background .15s, border-color .15s;
}
.notification-bell-btn:hover { background: var(--bg-soft, rgba(0,0,0,.05)); border-color: var(--border); }
.notification-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #e11d48; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.notification-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 480px; overflow: hidden;
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 32px rgba(0,0,0,.18);
  display: flex; flex-direction: column; z-index: 50;
}
.notification-panel[hidden] { display: none; }
.notification-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.notification-mark-all {
  background: transparent; border: 0; color: var(--text-muted);
  font-size: 12px; cursor: pointer; padding: 0;
}
.notification-mark-all:hover { color: var(--text); text-decoration: underline; }
.notification-panel-body { overflow-y: auto; flex: 1; }
.notification-panel-foot {
  padding: 8px 14px; border-top: 1px solid var(--border); text-align: center;
}
.notification-panel-foot a { font-size: 12px; color: var(--text-muted); }
.notification-item {
  display: flex; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft, var(--border));
  color: var(--text); text-decoration: none; cursor: pointer;
}
.notification-item:hover { background: var(--bg-soft, rgba(0,0,0,.04)); }
.notification-item.is-unread { background: rgba(59,130,246,.06); }
.notification-icon {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft, rgba(0,0,0,.06)); color: var(--text-muted);
  font-size: 12px;
}
.notification-text { display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.notification-actor { font-weight: 600; }
.notification-verb { color: var(--text); }
.notification-detail { color: var(--text-muted); }
.notification-time { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.notification-empty { padding: 24px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

@media (max-width: 480px) {
  .notification-panel { width: 92vw; right: -8px; }
}

/* ── Main content ───────────────────────────────────────── */
.app-content {
  grid-column: 2;
  padding: 28px;
  min-height: calc(100vh - 56px);
}
/* Annotate page — full-bleed canvas, no padding */
.app-content.no-pad {
  padding: 0;
  overflow: hidden;
  min-height: 0;
}

.messages-stack { margin-bottom: 20px; }


/* ════════════════════════════════════════════════════════
   INDEX / LANDING
═══════════════════════════════════════════════════════ */

.web-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 56px; height: 64px;
  background: rgba(9,9,14,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.web-nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -.03em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  overflow: visible;
  padding-bottom: 2px;
  display: inline-block;
}
.web-nav-logo em { color: var(--accent-bright); font-style: italic; }
.web-nav-links { display: flex; align-items: center; gap: 8px; }

.hero {
  padding: 148px 56px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -120px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 700px;
  background: radial-gradient(ellipse, rgba(99,102,241,.1) 0%, transparent 65%);
  pointer-events: none;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, black 0%, transparent 100%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  color: var(--accent-bright);
  font-family: 'DM Mono', monospace;
  letter-spacing: .06em;
  margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(40px, 6.5vw, 78px);
  line-height: 1.08;
  letter-spacing: -.04em;
  margin-bottom: 22px;
  overflow: visible;
  padding-bottom: 4px;
}
.hero h1 em { font-style: italic; color: var(--accent-bright); }
.hero-lead  { font-size: 18px; font-weight: 300; color: var(--text-muted); max-width: 500px; margin: 0 auto 40px; line-height: 1.75; }
.hero-cta   { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.stats-strip {
  max-width: 680px; margin: 64px auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.stat-item {
  padding: 24px 28px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 34px; font-weight: 900;
  color: var(--accent-bright);
  display: block; line-height: 1.2; margin-bottom: 5px;
  overflow: visible; padding-bottom: 2px;
}
.stat-lbl { font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; }

.features-section { max-width: 1100px; margin: 0 auto; padding: 20px 56px 100px; }
.features-header  { text-align: center; margin-bottom: 56px; }
.features-header h2 { font-size: 36px; margin-bottom: 10px; }
.features-header p  { color: var(--text-muted); font-size: 16px; }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: all .2s;
  position: relative; overflow: hidden;
}
.feature-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .2s;
}
.feature-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-card:hover::after { opacity: 1; }
.feature-icon { font-size: 26px; margin-bottom: 14px; display: block; }
.feature-card h3 { font-size: 16px; margin-bottom: 7px; }
.feature-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.65; }

.formats-section {
  background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 56px; text-align: center;
}
.formats-section h2 { font-size: 26px; margin-bottom: 8px; }
.formats-section p  { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; }
.format-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.format-chip {
  padding: 7px 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; font-family: 'DM Mono', monospace; font-size: 13px;
  color: var(--text-muted); transition: all .15s;
}
.format-chip:hover { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-glow); }

.cta-section { max-width: 560px; margin: 0 auto; padding: 96px 40px; text-align: center; }
.cta-section h2 { font-size: 36px; margin-bottom: 14px; }
.cta-section p  { color: var(--text-muted); font-size: 16px; margin-bottom: 30px; }

.web-footer {
  border-top: 1px solid var(--border);
  padding: 24px 56px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text-muted); font-size: 13px;
}
.web-footer-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 900; font-size: 16px; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
  overflow: visible; line-height: 1.4; display: inline-block; padding-bottom: 2px;
}
.web-footer-logo em { color: var(--accent-bright); font-style: italic; }


/* ════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════ */

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 460px;
}
@media (max-width: 880px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-side   { display: none; }
}

.auth-side {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 40px 52px;
  position: relative; overflow: hidden;
}
.auth-side::before {
  content: '';
  position: absolute; top: -80px; left: -80px;
  width: 480px; height: 480px;
  background: radial-gradient(ellipse, rgba(99,102,241,.09) 0%, transparent 70%);
  pointer-events: none;
}
.side-logo        { text-decoration: none; }
.side-content     { position: relative; z-index: 1; }
.side-content h2  { font-size: 34px; margin-bottom: 16px; line-height: 1.15; }
.side-content h2 em { font-style: italic; color: var(--accent-bright); }
.side-content > p { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; line-height: 1.7; }
.side-features    { display: flex; flex-direction: column; gap: 18px; }
.side-feature     { display: flex; gap: 14px; }
.side-feature-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--accent-glow); border: 1px solid var(--border-accent);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.side-feature h4  { font-size: 14px; margin-bottom: 2px; }
.side-feature p   { font-size: 12px; color: var(--text-muted); }
.auth-side-footer { font-size: 12px; color: var(--text-dim); position: relative; z-index: 1; }

.auth-main {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 40px;
}
.auth-box             { width: 100%; max-width: 370px; }
.auth-box-header      { margin-bottom: 30px; }
.auth-box-header h1   { font-size: 24px; margin-bottom: 5px; }
.auth-box-header p    { color: var(--text-muted); font-size: 14px; }
.auth-footer-link     { margin-top: 22px; text-align: center; font-size: 13px; color: var(--text-muted); }

.back-link {
  position: fixed; top: 20px; left: 20px;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; transition: color .15s; z-index: 10;
}
.back-link:hover { color: var(--text); }


/* ════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border-accent); }
.stat-card-label { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.stat-card-value {
  font-family: 'Syne', sans-serif;
  font-size: 34px; font-weight: 900;
  line-height: 1.2; color: var(--text);
  margin-bottom: 4px; overflow: visible; padding-bottom: 2px;
}
.stat-card-sub { font-size: 12px; color: var(--text-muted); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 960px) { .dashboard-grid { grid-template-columns: 1fr; } }

.project-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background .1s;
}
.project-row:last-child { border-bottom: none; }
.project-row:hover { background: var(--surface2); }
.project-row:hover .project-row-name { color: var(--accent-bright); }
.project-row-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--accent-glow); border: 1px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.project-row-info { flex: 1; min-width: 0; }
.project-row-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; transition: color .12s; }
.project-row-meta { font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
.progress-wrap  { flex-shrink: 0; min-width: 90px; text-align: right; }
.progress-bar   { width: 90px; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.progress-fill  { height: 100%; background: var(--accent); border-radius: 2px; }
.progress-lbl   { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }


/* ════════════════════════════════════════════════════════
   PROJECT CARDS
═══════════════════════════════════════════════════════ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: all .2s;
}
.project-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card-banner {
  height: 76px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; position: relative;
  background: linear-gradient(135deg, #13132a, #1a1028);
}
[data-theme="light"] .project-card-banner { background: linear-gradient(135deg, #e8e8f8, #ede8f8); }
.project-card-body      { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.project-card-name      { font-size: 15px; font-weight: 700; font-family: 'Syne', sans-serif; margin-bottom: 4px; overflow: visible; }
.project-card-desc      { font-size: 13px; color: var(--text-muted); line-height: 1.55; flex: 1; margin-bottom: 14px; }
.project-card-footer    { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
.project-stats          { display: flex; gap: 12px; }
.project-stat           { font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
.project-stat strong    { color: var(--text); }
.member-stack           { display: flex; }
.member-pip {
  width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
  margin-left: -5px; background: var(--accent-dim);
}
.member-pip:first-child { margin-left: 0; }


/* ════════════════════════════════════════════════════════
   IMAGE GRID / LIST
═══════════════════════════════════════════════════════ */

.filters-bar {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.filters-bar select,
.filters-bar input[type="search"],
.filters-bar input[type="date"] {
  width: auto; height: 36px; padding: 0 12px; font-size: 13px;
}
.filters-bar input[type="search"] { min-width: 200px; padding-left: 32px; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-btn    { padding: 6px 10px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; transition: all .12s; }
.view-btn.active { background: var(--surface2); color: var(--text); }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.image-grid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none; color: inherit; display: block;
  position: relative;
}
.image-grid-card:hover   { border-color: var(--accent); }
.image-grid-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

.image-thumb {
  aspect-ratio: 4/3;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  border-radius: var(--radius) var(--radius) 0 0;
}
.image-thumb img    { width: 100%; height: 100%; object-fit: cover; }
.image-thumb-ph     { font-size: 28px; color: var(--text-dim); }
.image-status-dot   { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; }
.image-status-dot.pending { background: var(--text-dim); }
.image-status-dot.partial { background: var(--warning); }
.image-status-dot.done    { background: var(--success); }

.image-info   { padding: 9px 11px 10px; }
.image-name   { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.image-meta   { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }

/* List view */
.image-list-view { display: none; }
.image-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background .1s;
}
.image-list-row:hover      { background: var(--surface2); }
.image-list-thumb          { width: 52px; height: 40px; background: var(--surface2); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.image-list-thumb img      { width: 100%; height: 100%; object-fit: cover; }
.image-list-name           { flex: 1; font-size: 14px; font-weight: 500; }
.image-list-status         { width: 90px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.image-list-date           { width: 110px; text-align: right; font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.drop-zone:hover,
.drop-zone.dragover { border-color: var(--accent); background: var(--accent-glow); }
.drop-zone-icon { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; }

/* Checkbox overlay */
.img-check-wrap {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  width: 22px; height: 22px; cursor: pointer;
}
.img-check-wrap input { display: none; }
.img-check-box {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.5);
  border-radius: 5px;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
  backdrop-filter: blur(4px);
}
.img-check-wrap input:checked ~ .img-check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.img-check-wrap input:checked ~ .img-check-box::after {
  content: '✓'; font-size: 11px; color: #fff; font-weight: 700;
}

/* Annotate button — top-right, shown on hover */
.img-annotate-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 26px; height: 26px;
  background: rgba(99,102,241,.8);
  border: 1px solid rgba(99,102,241,.5);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
  backdrop-filter: blur(6px);
  transition: all .12s;
  text-decoration: none;
  opacity: 0;
}
.image-grid-card:hover .img-annotate-btn { opacity: 1; }
.img-annotate-btn:hover { background: var(--accent); border-color: var(--accent-bright); color: #fff; transform: scale(1.08); }

/* Delete button — below annotate button */
.img-delete-btn-wrap {
  position: absolute; top: 40px; right: 8px; z-index: 3;
  opacity: 0; transition: opacity .12s;
}
.image-grid-card:hover .img-delete-btn-wrap { opacity: 1; }

.img-delete-btn {
  width: 26px; height: 26px;
  background: rgba(15,15,23,.75);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--danger);
  backdrop-filter: blur(6px);
  transition: all .12s;
  cursor: pointer; padding: 0; line-height: 1;
}
.img-delete-btn:hover { background: rgba(248,113,113,.25); border-color: var(--danger); }

/* Batch bar */
.batch-bar {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg); padding: 10px 16px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
  white-space: nowrap;
}
.batch-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: all;
}
.batch-count { font-size: 13px; font-weight: 600; color: var(--accent-bright); }

/* Tag chips */
.tag-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px; font-weight: 600;
  font-family: 'DM Mono', monospace;
  position: relative;
  background: transparent;
  color: var(--tc, #6366f1);
  border: 1px solid var(--tc, #6366f1);
  white-space: nowrap;
}
.tag-chip::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--tc, #6366f1);
  opacity: 0.15;
  pointer-events: none;
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 2px; }

/* Tag pick list in modal */
.tag-pick-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.tag-pick-item { cursor: pointer; }
.tag-pick-item input { display: none; }
.tag-pick-item input:checked ~ .tag-chip {
  outline: 2px solid var(--tc, var(--accent));
  outline-offset: 1px;
}
.hide-new-tag #new-tag-group { display: none; }

/* Image card link */
.image-card-link * { color: var(--text) !important; }
.image-card-link   { cursor: pointer; }
.image-card-link:visited, .image-card-link:hover, .image-card-link:active {
  color: inherit; text-decoration: none;
}


/* ════════════════════════════════════════════════════════
   PROFILE PAGE
═══════════════════════════════════════════════════════ */

.profile-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
@media (max-width: 780px) { .profile-layout { grid-template-columns: 1fr; } }

.profile-card       { text-align: center; }
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 14px; }

.tab-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 9px 18px; background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s; margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent-bright); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-pane        { display: none; }
.tab-pane.active { display: block; }

.danger-zone {
  background: rgba(248,113,113,.05);
  border: 1px solid rgba(248,113,113,.18);
  border-radius: var(--radius-lg);
  padding: 20px 22px; margin-top: 16px;
}
.danger-zone h3 { font-size: 14px; color: var(--danger); margin-bottom: 5px; }
.danger-zone p  { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }


/* ════════════════════════════════════════════════════════
   TEAM PAGE
═══════════════════════════════════════════════════════ */

.team-layout { display: grid; grid-template-columns: 1fr 290px; gap: 24px; }
@media (max-width: 860px) { .team-layout { grid-template-columns: 1fr; } }

.member-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.member-row:last-child { border-bottom: none; }
.member-row:hover      { background: var(--surface2); }
.member-row-info  { flex: 1; min-width: 0; }
.member-row-name  { font-size: 14px; font-weight: 600; }
.member-row-email { font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
.role-select { width: auto; padding: 5px 9px; font-size: 12px; height: 30px; border-radius: 6px; }

.role-info-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 8px;
}
.role-info-card h4 { font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.role-info-card p  { font-size: 12px; color: var(--text-muted); line-height: 1.55; }


/* ════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .web-nav    { padding: 0 20px; }
  .hero       { padding: 120px 20px 60px; }
  .features-grid { grid-template-columns: 1fr; }

  /* App shell: single column, sidebar hidden by default */
  .app-shell  { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 299;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
  }
  .sidebar-backdrop.visible { opacity: 1; pointer-events: all; }
  .toolbar    { grid-column: 1; padding: 0 14px; gap: 8px; }
  .toolbar-search { display: none; }
  .toolbar-sep { display: none; }
  .toolbar-title { font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toolbar .flex.gap-2 { flex-shrink: 0; }
  .app-content { grid-column: 1; padding: 14px; }

  /* Hamburger button shown on mobile */
  .mobile-menu-btn {
    display: flex;
    align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 16px; cursor: pointer;
    flex-shrink: 0;
  }

  /* Page header stacks on mobile */
  .page-header { flex-direction: column; gap: 10px; }
  .page-actions { flex-wrap: wrap; }

  /* Stats grid 2-col on mobile */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard grid single col */
  .dashboard-grid { grid-template-columns: 1fr; }

  /* Profile layout single col */
  .profile-layout { grid-template-columns: 1fr; }

  /* Team layout single col */
  .team-layout { grid-template-columns: 1fr; }
}

/* Hamburger hidden on desktop, shown on mobile via media query */
@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}

/* ── Polygon tool ──────────────────────────────────────── */
.canvas-wrap.tool-polygon { cursor: crosshair; }

.poly-shape {
  fill-opacity: 0.08;
  stroke-width: 2;
  cursor: pointer;
  transition: stroke-width .1s;
}
.poly-shape:hover    { stroke-width: 2.5; }
.poly-shape.selected { stroke-width: 2.5; fill-opacity: 0.18; }

.poly-ghost-dot {
  fill: #fff;
  stroke: #6366f1;
  stroke-width: 2;
  pointer-events: none;
}
.poly-close-dot {
  fill: #6366f1;
  stroke: #fff;
  stroke-width: 2;
  pointer-events: none;
}
/* ════════════════════════════════════════════════════════
   TEAM SECTION (Landing page)
   ADD THIS BLOCK TO style.css before the RESPONSIVE section
═══════════════════════════════════════════════════════ */

.team-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 56px 100px;
}

.team-header {
  text-align: center;
  margin-bottom: 52px;
}
.team-header h2 { font-size: 36px; margin-bottom: 10px; }
.team-header p  { color: var(--text-muted); font-size: 16px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .team-grid { grid-template-columns: 1fr; } }

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px 24px;
  text-align: center;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.team-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tc-gradient, linear-gradient(90deg, var(--accent), var(--accent-bright)));
}
.team-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.team-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 16px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.team-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Syne', sans-serif;
}

.team-name {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.team-role {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--accent-bright);
  font-weight: 500;
  letter-spacing: .03em;
  margin-bottom: 12px;
}
.team-bio {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: stretch;
}

.metric-card {
  height: 300px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card canvas {
  max-height: 260px;
  width: 100% !important;
}

.metric-card--wide {
  grid-column: span 2;
}

/* ── Crop preview layer ─────────────────────────────── */
.edit-preview-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 360px;
}

#edit-preview-canvas {
  display: block;
  border-radius: 6px;
  background: var(--surface2);
}

.edit-crop-box {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(99, 102, 241, 0.08);
  box-sizing: border-box;
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-sizing: border-box;
  touch-action: none;
}

.crop-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.crop-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.crop-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.crop-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
