/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --bg-card: #222222;
  --bg-elevated: #2a2a2a;
  --bg-input: #1a1a1a;
  --border: #333333;
  --border-focus: #666666;
  --text-primary: #f0f0f0;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent: #888888;
  --accent-hover: #aaaaaa;
  --danger: #cc3333;
  --success: #33aa55;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* --- Navbar --- */
.navbar { background: rgba(26,26,26,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
.logo { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); text-decoration: none; letter-spacing: -0.3px; transition: color var(--transition); }
.logo:hover { color: var(--accent-hover); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: color var(--transition); position: relative; font-size: 0.9rem; }
.nav-links a::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1px; background: var(--accent-hover); transition: width var(--transition); }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }
.user-name { color: var(--text-muted); font-size: 0.85rem; }

/* --- Page Header / Title --- */
.page-header { display: flex; justify-content: space-between; align-items: center; padding: 30px 0 20px; }
.page-title h1 { font-size: 1.8rem; color: var(--text-primary); font-weight: 600; letter-spacing: -0.5px; }
.page-title p { color: var(--text-muted); margin-top: 4px; font-size: 0.95rem; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 10px 24px; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; text-decoration: none; transition: all var(--transition); font-weight: 500; }
.btn:hover { background: #333; border-color: var(--border-focus); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-sm { padding: 6px 16px; font-size: 0.82rem; }
.btn-primary { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); }
.btn-primary:hover { background: #fff; border-color: #fff; box-shadow: 0 4px 20px rgba(255,255,255,0.12); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-secondary); }
.btn-secondary:hover { color: var(--text-primary); }
.btn-full { width: 100%; }
.btn-link { color: var(--accent-hover); text-decoration: none; font-weight: 500; display: inline-block; margin-bottom: 12px; transition: color var(--transition); }
.btn-link:hover { color: var(--text-primary); text-decoration: underline; }
.btn-link-sm { color: var(--accent-hover); text-decoration: none; font-size: 0.82rem; background: none; border: none; cursor: pointer; padding: 0; transition: color var(--transition); }
.btn-link-sm:hover { color: var(--text-primary); text-decoration: underline; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 80px 0; color: var(--text-muted); }
.empty-state p { font-size: 1.15rem; margin-bottom: 20px; }

/* --- Project Grid --- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 24px; padding: 20px 0; }
.project-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--border); transition: all var(--transition); animation: fadeIn 0.4s ease-out; }
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-focus); }
.project-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.project-header h3 { font-size: 1.15rem; }
.project-header h3 a { color: var(--text-primary); text-decoration: none; transition: color var(--transition); }
.project-header h3 a:hover { color: var(--accent-hover); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 500; border: 1px solid var(--border); }
.badge.primary { background: rgba(136,136,136,0.15); color: var(--accent-hover); border-color: rgba(136,136,136,0.3); }
.project-desc { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 16px; line-height: 1.6; }
.project-progress { margin-bottom: 16px; }
.progress-bar { height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; margin-bottom: 8px; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 4px; transition: width 0.3s; }
.progress-text { font-size: 0.82rem; color: var(--text-muted); }
.project-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.creator { font-size: 0.82rem; color: var(--text-muted); }

/* --- Board --- */
.board-header { padding: 24px 0 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.board-header h1 { font-size: 1.6rem; color: var(--text-primary); font-weight: 600; letter-spacing: -0.5px; }
.project-subtitle { color: var(--text-muted); font-size: 0.9rem; }
.board-actions { display: flex; gap: 12px; }
.members-section { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px 24px; margin-bottom: 24px; border: 1px solid var(--border); }
.members-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.members-header h3 { font-size: 0.95rem; color: var(--text-secondary); font-weight: 600; }
.members-list { display: flex; gap: 8px; flex-wrap: wrap; }
.member-badge { background: var(--bg-elevated); color: var(--text-secondary); padding: 4px 12px; border-radius: 20px; font-size: 0.82rem; font-weight: 500; border: 1px solid var(--border); }
.add-member-form { display: flex; gap: 8px; align-items: center; }
.add-member-form select { padding: 6px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: 0.85rem; }
.add-member-form select:focus { outline: none; border-color: var(--border-focus); }

.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 40px; }
.column { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 16px; min-height: 500px; border: 1px solid var(--border); }
.column-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 0 4px; }
.column-header h2 { font-size: 0.95rem; color: var(--text-secondary); }
.task-count { background: var(--bg-elevated); color: var(--text-muted); padding: 2px 8px; border-radius: 10px; font-size: 0.78rem; font-weight: 600; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; }
.status-dot.todo { background: var(--text-muted); }
.status-dot.in-progress { background: var(--accent-hover); }
.status-dot.done { background: var(--success); }
.empty-column { text-align: center; color: var(--text-muted); padding: 40px 0; font-size: 0.88rem; }

/* --- Task Card --- */
.task-card { background: var(--bg-card); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; border: 1px solid var(--border); cursor: pointer; transition: all var(--transition); border-left: 4px solid var(--border); }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); border-color: var(--border-focus); }
.task-card.in-progress { border-left-color: var(--accent-hover); }
.task-card.done { border-left-color: var(--success); opacity: 0.7; }
.task-card h4 { font-size: 0.92rem; margin-bottom: 6px; font-weight: 600; }
.task-card h4 a { color: var(--text-primary); text-decoration: none; transition: color var(--transition); }
.task-card h4 a:hover { color: var(--accent-hover); }
.task-card h4 a.done-text { text-decoration: line-through; color: var(--text-muted); }
.task-preview { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 10px; }
.task-footer { display: flex; justify-content: space-between; align-items: center; }
.task-assignee { font-size: 0.78rem; color: var(--text-muted); }
.task-actions { display: flex; gap: 8px; }
.status-form { display: inline; }
.inline-form { display: inline; }
.inline-select { padding: 6px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: 0.85rem; }
.inline-select:focus { outline: none; border-color: var(--border-focus); }

/* --- Auth --- */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 56px); padding: 20px; background: radial-gradient(ellipse at 50% 0%, #1a1a1a 0%, var(--bg-primary) 70%); }
.auth-card { background: var(--bg-card); padding: 40px; border-radius: var(--radius-lg); border: 1px solid var(--border); width: 100%; max-width: 420px; text-align: center; animation: slideUp 0.5s ease-out; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.auth-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.auth-card h1 { margin-bottom: 25px; text-align: center; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.5px; }
.auth-link { text-align: center; margin-top: 18px; color: var(--text-muted); font-size: 0.9rem; }
.auth-link a { color: var(--accent-hover); text-decoration: none; transition: color var(--transition); }
.auth-link a:hover { color: var(--text-primary); text-decoration: underline; }
.auth-note { text-align: center; margin-top: 10px; color: var(--text-muted); font-size: 0.82rem; }

/* --- Form Container --- */
.form-container { display: flex; justify-content: center; padding: 40px 0; }
.form-card { background: var(--bg-card); padding: 32px; border-radius: var(--radius-lg); border: 1px solid var(--border); width: 100%; max-width: 560px; animation: slideUp 0.4s ease-out; }
.form-card h1 { margin-bottom: 24px; font-size: 1.4rem; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.85rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem; transition: all var(--transition); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(136,136,136,0.1); }
.form-group textarea { height: 100px; resize: vertical; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* --- Alerts --- */
.alert { padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.9rem; }
.alert.error { background: rgba(204,51,51,0.1); color: #ff6666; border: 1px solid rgba(204,51,51,0.3); }

/* --- Task Detail --- */
.task-detail-page { padding: 24px 0; }
.task-main { max-width: 800px; margin: 0 auto; }
.task-detail-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px; border: 1px solid var(--border); animation: fadeIn 0.4s ease-out; }
.task-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.task-detail-header h1 { font-size: 1.4rem; margin: 0; color: var(--text-primary); }
.status-badge { padding: 4px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; text-transform: uppercase; border: 1px solid var(--border); }
.status-badge.todo { background: rgba(102,102,102,0.15); color: var(--text-muted); border-color: rgba(102,102,102,0.3); }
.status-badge.in_progress { background: rgba(136,136,136,0.15); color: var(--accent-hover); border-color: rgba(136,136,136,0.3); }
.status-badge.done { background: rgba(51,170,85,0.15); color: var(--success); border-color: rgba(51,170,85,0.3); }
.task-meta { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 20px; }
.task-description { margin-bottom: 24px; }
.task-description h3 { font-size: 0.95rem; margin-bottom: 8px; color: var(--text-secondary); }
.task-description p { color: var(--text-secondary); line-height: 1.7; }
.task-info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-item label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { font-weight: 500; color: var(--text-primary); }

/* --- Comments --- */
.comments-section h2 { font-size: 1.15rem; margin-bottom: 16px; color: var(--text-primary); }
.comment-form-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 24px; border: 1px solid var(--border); }
.comment-form-card textarea { width: 100%; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem; resize: vertical; font-family: inherit; transition: border var(--transition); }
.comment-form-card textarea:focus { outline: none; border-color: var(--border-focus); }
.no-comments { color: var(--text-muted); text-align: center; padding: 20px; }
.comments-list { display: flex; flex-direction: column; gap: 16px; }
.comment { background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--border); animation: fadeIn 0.3s ease-out; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.comment-author { font-weight: 600; color: var(--text-primary); }
.comment-date { font-size: 0.78rem; color: var(--text-muted); }
.comment-body { color: var(--text-secondary); line-height: 1.6; font-size: 0.9rem; }

/* --- Footer --- */
.footer { background: #0a0a0a; color: var(--text-muted); text-align: center; padding: 25px 0; margin-top: auto; border-top: 1px solid var(--border); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-focus); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .board { grid-template-columns: 1fr; }
  .column { min-height: auto; }
}
@media (max-width: 768px) {
  .project-grid { grid-template-columns: 1fr; }
  .navbar .container { flex-direction: column; gap: 10px; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .members-header { flex-direction: column; align-items: flex-start; }
  .add-member-form { width: 100%; }
  .add-member-form select { flex: 1; }
}
