/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #1a1a2e;
  --brand-mid: #16213e;
  --accent: #465568;
  --accent-hover: #3a4758;
  --accent-light: #eef1f4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
  --sidebar-w: 240px;
  --transition: 0.18s ease;
}

html { font-size: 14px; }
body {
  font-family: 'Sora', sans-serif;
  background: var(--surface-2);
  color: var(--text-1);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ===== SCREEN SYSTEM ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ===== AUTH ===== */
.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.auth-brand {
  flex: 0 0 480px;
  background: linear-gradient(135deg, #0f172a 0%, #2d3542 60%, #1a1a2e 100%);
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(70,85,104,0.2) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.auth-brand::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  bottom: -50px; right: -50px;
}

.brand-logo {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}
.brand-logo.small { font-size: 16px; }
.logo-icon { font-size: 22px; }

.brand-headline {
  font-size: 42px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.brand-headline em { font-style: italic; color: #9aa8b8; }

.brand-sub {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.brand-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 48px;
}
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 24px; font-weight: 700; color: white; }
.stat-label { font-size: 12px; color: #64748b; }

.brand-visual { position: relative; }
.floating-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: white;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  animation: float 3s ease-in-out infinite;
}
.fc2 { animation-delay: 0.5s; margin-left: 20px; }
.fc3 { animation-delay: 1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.fc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fc-dot.high { background: #ef4444; }
.fc-dot.med { background: #f59e0b; }
.fc-dot.low { background: #10b981; }

.auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: var(--surface);
}

.auth-tabs {
  display: flex;
  background: var(--surface-3);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 32px;
  width: 360px;
}
.auth-tab {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow);
}

.auth-form { display: none; width: 360px; }
.auth-form.active { display: block; }

.auth-form h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.form-sub { color: var(--text-2); margin-bottom: 24px; }

/* ===== FORM ELEMENTS ===== */
.field-group { margin-bottom: 16px; }
.field-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }

.field-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-1);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70,85,104,0.12); }
.field-input.input-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
.field-input.input-error:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.field-error { display: none; font-size: 12px; color: var(--danger); margin-top: 6px; line-height: 1.35; }
.field-error.has-msg { display: block; }
.field-input.sm { padding: 7px 10px; font-size: 13px; }

.field-select { cursor: pointer; }
.field-textarea { resize: vertical; min-height: 80px; }

.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.field-row-half { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.link-small { font-size: 13px; color: var(--accent); text-decoration: none; }
.link-small:hover { text-decoration: underline; }

.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(70,85,104,0.35); }
.btn-primary.full { width: 100%; justify-content: center; }
.btn-primary.sm { padding: 8px 14px; font-size: 13px; }
.btn-primary.xs { padding: 5px 10px; font-size: 12px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text-1); border-color: var(--border-2); }
.btn-ghost.sm { padding: 7px 12px; font-size: 13px; }
.btn-ghost.xs { padding: 4px 8px; font-size: 12px; }
.btn-ghost.full { width: 100%; justify-content: center; margin-top: 12px; }

.btn-icon-del {
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  border-radius: 6px;
  transition: var(--transition);
}
.btn-icon-del:hover { background: #fee2e2; color: var(--danger); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-3);
  font-size: 12px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-social {
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-social:hover { background: var(--surface-3); }

.terms-note { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 16px; }
.terms-note a { color: var(--accent); text-decoration: none; }

/* ===== ONBOARDING ===== */
#screen-onboarding { flex-direction: column; align-items: center; justify-content: flex-start; padding: 40px 20px; }

.onboard-wrap { width: 100%; max-width: 520px; }

.onboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.onboard-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.step.active { background: var(--accent); color: white; }
.step.done { background: var(--success); color: white; }
.step-line { width: 40px; height: 2px; background: var(--border); }

.onboard-step { display: none; }
.onboard-step.active { display: block; }
.onboard-icon { font-size: 40px; margin-bottom: 12px; }
.onboard-step h2 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }

.size-options { display: flex; gap: 8px; flex-wrap: wrap; }
.size-opt {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.size-opt.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 600; }

.account-type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.account-type-opt {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: var(--transition);
}
.account-type-opt .sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 2px;
}
.account-type-opt.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.account-type-opt.active .sub { color: var(--text-2); }

.form-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
  line-height: 1.45;
}
.onboard-note {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  line-height: 1.45;
}

.url-field { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.url-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70,85,104,0.12); }
.url-prefix { padding: 10px 12px; background: var(--surface-3); color: var(--text-2); font-size: 13px; white-space: nowrap; border-right: 1px solid var(--border); }
.url-input { border: none; border-radius: 0; box-shadow: none; }
.url-input:focus { box-shadow: none; border-color: transparent; }

.invite-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.invite-row .field-select { width: auto; }

.roles-explainer { background: var(--surface-3); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.role-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.role-item:last-child { margin-bottom: 0; }

.role-badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.role-badge.admin { background: #ede9fe; color: #5b21b6; }
.role-badge.member { background: var(--accent-light); color: var(--accent); }
.role-badge.viewer { background: #f1f5f9; color: #475569; }
.role-badge.client { background: #fef3c7; color: #92400e; }

.mm-item.client-row { border-left: 3px solid var(--warning); }
.share-link-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}
.share-link-box .field-input { flex: 1; font-size: 12px; font-family: 'DM Mono', monospace; }

.onboard-nav { display: flex; justify-content: space-between; margin-top: 20px; }

.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.template-card {
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.template-card:hover { border-color: var(--accent); background: var(--accent-light); }
.template-card.active { border-color: var(--accent); background: var(--accent-light); }
.template-icon { font-size: 28px; margin-bottom: 8px; }
.template-name { font-weight: 600; font-size: 14px; }
.template-desc { font-size: 12px; color: var(--text-3); }

/* ===== MAIN APP LAYOUT ===== */
#screen-app {
  flex-direction: row;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  transition: width var(--transition);
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.workspace-badge {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-plan {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

.sidebar-nav { padding: 12px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-3); color: var(--text-1); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-section-label {
  padding: 8px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-3);
}

.sidebar-projects { padding: 0 8px; }
.project-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}
.project-nav-item:hover { background: var(--surface-3); color: var(--text-1); }
.project-nav-item.active { background: var(--surface-3); color: var(--text-1); font-weight: 500; }

.proj-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.sidebar-add {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.user-pill:hover { background: var(--surface-3); }

.user-info { flex: 1; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-1); }
.user-role { display: block; font-size: 11px; color: var(--text-3); }
.settings-icon { color: var(--text-3); }

/* MAIN */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-2);
  padding: 4px;
}

.breadcrumb { font-size: 14px; font-weight: 600; color: var(--text-1); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
}
.search-bar.sm { padding: 6px 10px; }
.search-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
  width: 200px;
}

.notif-btn {
  position: relative;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}
.notif-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

.topbar-avatar { cursor: pointer; }

/* VIEW CONTENT */
.view-content { flex: 1; overflow-y: auto; }
.view { display: none; padding: 28px 28px; }
.view.active { display: block; }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.view-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.view-sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== AVATARS ===== */
.avatar {
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
}
.avatar.lg { width: 48px; height: 48px; font-size: 14px; }
.avatar.sm { width: 32px; height: 32px; font-size: 11px; }
.avatar.xs { width: 26px; height: 26px; font-size: 10px; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ===== PRIORITY TAGS ===== */
.priority-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.priority-tag.high { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.priority-tag.med { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.priority-tag.low { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ===== STATUS ===== */
.status-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-pill.todo { background: #f1f5f9; color: #475569; }
.status-pill.inprog { background: var(--accent-light); color: var(--accent); }
.status-pill.review { background: #fef3c7; color: #92400e; }
.status-pill.done { background: #d1fae5; color: #065f46; }

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-badge.active { background: var(--accent-light); color: var(--accent); }
.status-badge.review { background: #d1fae5; color: #065f46; }
.status-badge.completed { background: #f1f5f9; color: #475569; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-header h3 { font-size: 15px; font-weight: 600; }

/* ===== DASHBOARD ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card-label { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card-num { font-size: 32px; font-weight: 700; color: var(--text-1); line-height: 1; margin-bottom: 8px; }
.stat-card-num.danger { color: var(--danger); }
.stat-card-change { font-size: 12px; }
.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.dash-col-main { display: flex; flex-direction: column; gap: 20px; }
.dash-col-side { display: flex; flex-direction: column; gap: 20px; }

.project-list-dash { display: flex; flex-direction: column; gap: 12px; }

.proj-dash-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.proj-dash-item:hover { background: var(--surface-3); border-color: var(--border-2); }

.proj-color-bar { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.proj-dash-info { flex: 1; }
.proj-dash-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.proj-dash-meta { font-size: 12px; color: var(--text-3); }
.proj-dash-right { display: flex; align-items: center; gap: 12px; }

.progress-ring { position: relative; width: 40px; height: 40px; }
.progress-ring svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray 0.4s; }
.progress-ring span {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-1);
}

.task-quick-list { display: flex; flex-direction: column; gap: 8px; }
.quick-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: var(--transition);
}
.quick-task:hover { background: var(--surface-3); }
.quick-task.done .qt-name { text-decoration: line-through; color: var(--text-3); }
.quick-task.overdue { background: #fff1f2; }

.qt-name { flex: 1; font-size: 13.5px; }

.activity-feed { display: flex; flex-direction: column; gap: 12px; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; }
.act-text { flex: 1; font-size: 13px; color: var(--text-2); }
.act-text strong { color: var(--text-1); }
.act-text em { color: var(--accent); font-style: normal; }
.act-time { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

.deadline-list { display: flex; flex-direction: column; gap: 10px; }
.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 3px solid var(--border);
}
.deadline-item.overdue { background: #fff1f2; border-left-color: var(--danger); }
.deadline-item.warning { background: #fffbeb; border-left-color: var(--warning); }

.dl-date { font-size: 12px; font-weight: 700; color: var(--text-2); width: 36px; flex-shrink: 0; }
.dl-info { flex: 1; }
.dl-name { font-size: 13px; font-weight: 600; }
.dl-sub { font-size: 12px; color: var(--text-3); }

.dl-badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.dl-badge.overdue { background: #fee2e2; color: #b91c1c; }
.dl-badge.warning { background: #fef3c7; color: #92400e; }
.dl-badge.ok { background: #d1fae5; color: #065f46; }

/* ===== PROJECTS GRID ===== */
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.filter-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.filter-tab:hover:not(.active) { border-color: var(--border-2); }

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-2); }

.pc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.pc-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.pc-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.3px; }
.pc-tech { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }

.pc-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.progress-bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress-bar.sm { height: 4px; }
.progress-bar.lg { height: 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s ease; }
.progress-pct { font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; }

.pc-footer { display: flex; justify-content: space-between; align-items: center; }
.pc-meta { font-size: 11px; color: var(--text-3); }

.new-card {
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  box-shadow: none;
}
.new-card:hover { border-color: var(--accent); background: var(--accent-light); }
.new-project-inner { text-align: center; }
.new-proj-icon { font-size: 28px; color: var(--text-3); margin-bottom: 8px; }
.new-proj-text { font-size: 14px; color: var(--text-2); font-weight: 500; }

/* ===== KANBAN ===== */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.kanban-col {
  flex: 0 0 280px;
  background: var(--surface-3);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.col-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
}
.col-dot.todo { background: #94a3b8; }
.col-dot.inprog { background: var(--accent); }
.col-dot.review { background: #f59e0b; }
.col-dot.done { background: #10b981; }

.col-count {
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.btn-col-add {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
}
.btn-col-add:hover { background: var(--border); color: var(--text-1); }

.kanban-cards {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}
.task-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.task-card.done-card { opacity: 0.6; }
.task-card.dragging { opacity: 0.5; transform: rotate(2deg); }

.tc-header { margin-bottom: 8px; }
.tc-title { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.tc-sub { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.tc-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--text-2); }

.tc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.tc-meta { font-size: 11px; color: var(--text-3); }

/* List View */
.project-list-view { overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

.task-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.3px;
}

.task-row { cursor: pointer; transition: background var(--transition); }
.task-row:hover { background: var(--surface-2); }
.task-row td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }

.td-name { font-weight: 500; }
.td-assignee { display: flex; align-items: center; gap: 6px; }
.overdue-row td { background: #fff8f8; }

.btn-row-action {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-row-action:hover { background: var(--surface-3); }

/* View Toggle */
.view-toggle { display: flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; }
.view-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.view-btn.active { background: var(--surface); color: var(--text-1); box-shadow: var(--shadow); }

/* Timeline */
.project-timeline-view { overflow-x: auto; }
.timeline-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.tl-label-col { width: 200px; flex-shrink: 0; padding-left: 16px; }
.tl-months { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }

.timeline-rows { display: flex; flex-direction: column; gap: 8px; }
.tl-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tl-task-name { width: 200px; flex-shrink: 0; padding: 12px 16px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.tl-bar-area { flex: 1; position: relative; height: 44px; background: var(--surface-2); }
.tl-bar {
  position: absolute;
  top: 10px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  color: white;
}

/* My Tasks */
.my-tasks-sections { display: flex; flex-direction: column; gap: 24px; }
.task-section {}
.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-label.overdue-label { color: var(--danger); }

.task-row-list { display: flex; flex-direction: column; gap: 8px; }
.task-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.task-list-item:hover { background: var(--surface-2); border-color: var(--border-2); }
.task-list-item.overdue { border-left: 3px solid var(--danger); background: #fff8f8; }

.tli-content { flex: 1; }
.tli-title { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.tli-meta { font-size: 12px; color: var(--text-3); }
.tli-right { display: flex; align-items: center; gap: 8px; }

.overdue-badge {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Analytics */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.analytics-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.chart-placeholder { height: 180px; display: flex; flex-direction: column; }
.bar-chart { flex: 1; }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; background: var(--accent-light); border-radius: 4px 4px 0 0; transition: height 0.3s; }
.chart-bar.accent { background: var(--accent); }
.chart-bar-wrap span { font-size: 11px; color: var(--text-3); }
.chart-legend { display: flex; gap: 16px; margin-top: 8px; }
.cl-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.cl-dot { width: 10px; height: 10px; border-radius: 2px; }

.donut-chart { display: flex; align-items: center; gap: 20px; }
.donut-svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.donut-center-text { fill: var(--text-1); font-size: 16px; font-weight: 700; transform: rotate(90deg); transform-origin: 60px 60px; }
.donut-legend { flex: 1; }
.dl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.dl-row strong { margin-left: auto; color: var(--text-1); }
.dl-dot { width: 10px; height: 10px; border-radius: 50%; }

.velocity-list { display: flex; flex-direction: column; gap: 12px; }
.vel-item { display: flex; align-items: center; gap: 10px; }
.vel-user { display: flex; align-items: center; gap: 6px; font-size: 13px; width: 100px; flex-shrink: 0; }
.vel-bar { flex: 1; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.vel-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #6b7c91); border-radius: 4px; }
.vel-count { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }

.proj-status-list { display: flex; flex-direction: column; gap: 16px; }
.ps-item {}
.ps-info { display: flex; justify-content: space-between; margin-bottom: 6px; }
.ps-name { font-size: 13px; font-weight: 500; }
.ps-pct { font-size: 13px; font-weight: 700; color: var(--text-2); }
.ps-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
}
.member-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.mc-top { display: flex; justify-content: center; position: relative; margin-bottom: 12px; }
.mc-badge {
  position: absolute;
  top: 0; right: 0;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.mc-badge.admin { background: #ede9fe; color: #5b21b6; }
.mc-badge.member { background: var(--accent-light); color: var(--accent); }
.mc-badge.viewer { background: #f1f5f9; color: #475569; }

.mc-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.mc-email { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.mc-stats { display: flex; justify-content: center; gap: 20px; margin-bottom: 14px; }
.mc-stat { font-size: 12px; color: var(--text-2); }
.mc-stat span { display: block; font-size: 18px; font-weight: 700; color: var(--text-1); }
.mc-actions { display: flex; gap: 8px; justify-content: center; }

/* ===== SIDE PANEL (Task Detail) ===== */
.side-panel {
  position: fixed;
  top: 0;
  right: -560px;
  width: 560px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.side-panel.open { right: 0; }

.sp-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.sp-close {
  float: right;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.sp-close:hover { background: var(--surface-3); color: var(--text-1); }

.sp-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.sp-header h2 { font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -0.3px; clear: both; }

.sp-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }

.sp-section {}

.sp-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sp-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.sp-meta-item:nth-child(even) { border-right: none; }
.sp-meta-label { font-size: 11px; color: var(--text-3); font-weight: 500; }
.sp-meta-val { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 4px; }

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.pct-badge { background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.count-badge { background: var(--surface-3); color: var(--text-2); font-size: 12px; padding: 2px 7px; border-radius: 20px; }

.time-tracked { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.td-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; }

.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition);
}
.subtask-item:hover { background: var(--surface-3); }
.subtask-item.done span { text-decoration: line-through; color: var(--text-3); }

.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.attach-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.attach-icon.fig { background: #ede9fe; color: #5b21b6; }
.attach-icon.pdf { background: #fee2e2; color: #b91c1c; }

.attach-info { flex: 1; }
.attach-name { font-size: 13px; font-weight: 500; }
.attach-size { font-size: 11px; color: var(--text-3); }

.comment-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.comment-item { display: flex; gap: 10px; }
.comment-body { flex: 1; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.comment-author { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.comment-time { font-weight: 400; color: var(--text-3); margin-left: 6px; }
.comment-text { font-size: 13.5px; color: var(--text-2); }

.comment-input-row { display: flex; align-items: center; gap: 8px; }
.comment-field { flex: 1; }

.label-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  margin-bottom: 4px;
}
.label-chip.selectable { cursor: pointer; background: var(--surface-3); color: var(--text-2); border: 1.5px solid var(--border); transition: var(--transition); }
.label-chip.selectable.selected { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ===== MODALS ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 150;
  display: none;
  backdrop-filter: blur(2px);
}
.overlay.visible { display: block; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  overflow: hidden;
}
.modal.open {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* Modal Specific */
.label-options { display: flex; flex-wrap: wrap; gap: 4px; }

.color-picker { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.color-opt {
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
}
.color-opt:hover { transform: scale(1.2); }
.color-opt.active { border-color: var(--text-1); transform: scale(1.15); }

.member-select { display: flex; flex-wrap: wrap; gap: 8px; }
.member-sel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.member-sel-item:hover { border-color: var(--accent); background: var(--accent-light); }
.member-sel-item.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 500; }

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

.member-manage-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.mm-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.mm-info { flex: 1; }
.mm-name { font-size: 13px; font-weight: 600; }
.mm-email { font-size: 12px; color: var(--text-3); }
.mm-item .field-select { width: auto; }
.remove-btn { color: var(--danger) !important; border-color: var(--danger) !important; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0f172a;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 500;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .auth-brand { display: none; }
  .sidebar { position: fixed; left: -240px; z-index: 100; height: 100vh; }
  .sidebar.open { left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kanban-board { gap: 12px; }
  .kanban-col { flex: 0 0 250px; }
}
