/* ===== ProjectHub CSS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-w: 250px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--gray-100); color: var(--gray-800); font-size: 14px; line-height: 1.5; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LOGIN PAGE ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -1px; }
.login-logo p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-w); background: var(--gray-900); color: #fff; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 100; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header h2 { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.sidebar-header p { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-section { padding: 8px 16px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-500); }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--gray-300); font-size: 13.5px; transition: all .15s; border-left: 3px solid transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--primary); text-decoration: none; }
.sidebar-nav .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-user { padding: 16px; border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .info strong { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info span { font-size: 11px; color: var(--gray-400); }
.sidebar-user a { color: var(--gray-400); font-size: 18px; }
.sidebar-user a:hover { color: var(--danger); }

.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.topbar .actions { display: flex; gap: 10px; }

.page-body { padding: 28px; flex: 1; }

/* ===== CARDS ===== */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-200); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid var(--gray-200); box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); margin-bottom: 8px; }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-card .sub { font-size: 12px; color: var(--gray-400); margin-top: 6px; }
.stat-card.accent-blue .value { color: var(--primary); }
.stat-card.accent-green .value { color: var(--success); }
.stat-card.accent-yellow .value { color: var(--warning); }
.stat-card.accent-red .value { color: var(--danger); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--gray-50); padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); }
td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.badge-todo      { background: var(--gray-100); color: var(--gray-600); }
.badge-progress  { background: #dbeafe; color: #1d4ed8; }
.badge-review    { background: #fef3c7; color: #92400e; }
.badge-done      { background: #d1fae5; color: #065f46; }
.badge-blocked   { background: #fee2e2; color: #991b1b; }

.pri-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.pri-low      { background: #f0fdf4; color: #15803d; }
.pri-medium   { background: #fefce8; color: #854d0e; }
.pri-high     { background: #fff7ed; color: #c2410c; }
.pri-critical { background: #fef2f2; color: #b91c1c; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 13.5px; color: var(--gray-800); transition: border-color .15s, box-shadow .15s; background: #fff; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); color: var(--gray-800); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-600); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ===== FLASH MESSAGES ===== */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ===== AVATAR ===== */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; }
.av-purple { background: #7c3aed; }
.av-blue   { background: #2563eb; }
.av-green  { background: #059669; }
.av-orange { background: #d97706; }
.av-pink   { background: #db2777; }
.av-teal   { background: #0891b2; }

.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -6px; border: 2px solid #fff; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ===== PROJECT CARDS ===== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.project-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s; }
.project-card:hover { box-shadow: var(--shadow-md); }
.project-card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.project-card-desc { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.project-card-meta { display: flex; align-items: center; justify-content: space-between; }
.project-card-dates { font-size: 12px; color: var(--gray-400); }
.progress-bar { background: var(--gray-100); border-radius: 99px; height: 6px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .3s; }

/* ===== TASK DETAIL ===== */
.task-detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.comments-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 10px; }
.comment-body { background: var(--gray-50); border-radius: 8px; padding: 10px 14px; flex: 1; border: 1px solid var(--gray-200); }
.comment-body .comment-meta { font-size: 12px; color: var(--gray-400); margin-bottom: 5px; }
.comment-body p { font-size: 13.5px; color: var(--gray-700); }

/* ===== MODAL ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 500px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--gray-900); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ===== MISC ===== */
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-400); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

.member-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light); color: var(--primary-dark); border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 600; margin: 2px; }

.task-row { cursor: pointer; }
.task-row:hover td { background: var(--primary-light) !important; }

.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .key { color: var(--gray-500); font-weight: 500; }
.info-row .val { color: var(--gray-800); font-weight: 600; }

.page-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--gray-200); padding-bottom: 0; }
.page-tabs a { padding: 8px 16px; font-size: 13.5px; font-weight: 600; color: var(--gray-500); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.page-tabs a.active, .page-tabs a:hover { color: var(--primary); border-bottom-color: var(--primary); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .task-detail-grid { grid-template-columns: 1fr; }
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafafa;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: #4f46e5;
  background: #eef2ff;
}
.upload-zone .upload-icon { font-size: 32px; margin-bottom: 6px; }
.upload-zone .upload-text { font-weight: 600; color: #374151; font-size: 14px; }
.upload-zone .upload-sub  { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.img-thumb { position:relative; width:80px; height:80px; border-radius:8px; overflow:hidden; border:1px solid #e5e7eb; flex-shrink:0; }
.img-thumb img { width:100%; height:100%; object-fit:cover; }
.img-thumb .rm { position:absolute; top:2px; right:2px; background:rgba(0,0,0,.6); color:#fff; border:none; border-radius:50%; width:18px; height:18px; font-size:11px; cursor:pointer; display:flex; align-items:center; justify-content:center; line-height:1; }

/* ===== TASK TYPE BADGE ===== */
.type-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 9px; border-radius:20px; font-size:11px; font-weight:700; }
