/* ============================================================
   CHECKLIST PMS — Stylesheet
   Clean, soothing, light animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #273548;
  --bg-input: #0f172a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99,102,241,.25);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --border: rgba(148,163,184,.12);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.3);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* ── LOADING SCREEN ────────────────────────────── */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-primary);
  transition: opacity .5s ease;
}
#loading-screen.hide { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 52px; height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { margin-top: 16px; color: var(--text-secondary); font-size: .9rem; }

/* ── NOTIFICATION BANNER ───────────────────────── */
.notif-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; font-size: .85rem; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between;
  transform: translateY(-100%);
  transition: transform .4s ease;
}
.notif-banner.show { transform: translateY(0); }
.notif-banner button {
  background: rgba(255,255,255,.25); border: none; color: #fff;
  padding: 6px 16px; border-radius: 6px; cursor: pointer; font-weight: 600;
}

/* ── NOTIFICATION POPUP (first time) ───────────── */
.notif-popup-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.notif-popup-overlay.show { opacity: 1; pointer-events: all; }
.notif-popup {
  background: var(--bg-secondary); border-radius: var(--radius);
  padding: 32px; max-width: 400px; width: 90%;
  text-align: center; box-shadow: var(--shadow);
  animation: popIn .4s ease;
}
@keyframes popIn {
  from { transform: scale(.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.notif-popup .icon { font-size: 3rem; margin-bottom: 12px; }
.notif-popup h2 { font-size: 1.25rem; margin-bottom: 8px; }
.notif-popup p { color: var(--text-secondary); font-size: .88rem; margin-bottom: 24px; }
.notif-popup .btn-group { display: flex; gap: 10px; justify-content: center; }

/* ── HEADER ────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,23,42,.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-header .logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.15rem;
}
.app-header .logo span { color: var(--accent-light); }
.header-user {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-secondary); font-size: .85rem;
}
.header-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: #fff;
}

/* ── NAV TABS ──────────────────────────────────── */
.nav-tabs {
  display: flex; gap: 4px;
  padding: 8px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.nav-tab {
  padding: 10px 20px; border: none;
  background: transparent; color: var(--text-secondary);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text-primary); background: rgba(99,102,241,.08); }
.nav-tab.active {
  color: var(--accent-light);
  background: rgba(99,102,241,.15);
  font-weight: 600;
}

/* ── MAIN CONTENT ──────────────────────────────── */
.main-content {
  max-width: 1100px; margin: 0 auto;
  padding: 24px;
}
.section { display: none; animation: fadeUp .35s ease; }
.section.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── SECTION HEADER ────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-header h1 { font-size: 1.5rem; font-weight: 700; }
.section-header h1 .count {
  font-size: .85rem; color: var(--text-muted); font-weight: 400; margin-left: 6px;
}

/* ── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border: none;
  border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff; box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-success { background: rgba(34,197,94,.15); color: var(--success); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.btn-icon:hover { color: var(--text-primary); background: var(--bg-card-hover); }

/* ── CARDS ─────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.card:hover { border-color: rgba(99,102,241,.2); }

/* ── TASK CARD ─────────────────────────────────── */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.task-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 4px 0 0 4px;
}
.task-card.priority-high::before { background: var(--danger); }
.task-card.priority-medium::before { background: var(--warning); }
.task-card.priority-low::before { background: var(--success); }
.task-card:hover { border-color: rgba(99,102,241,.2); transform: translateX(3px); }

.task-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-title { font-weight: 600; font-size: .95rem; }
.task-title.completed { text-decoration: line-through; color: var(--text-muted); }
.task-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; font-size: .78rem; color: var(--text-muted);
}
.task-meta-item { display: flex; align-items: center; gap: 4px; }
.task-actions { display: flex; gap: 4px; flex-shrink: 0; }
.task-desc {
  margin-top: 8px; font-size: .85rem;
  color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ── STATUS BADGE ──────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}
.badge-pending { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-in-progress { background: rgba(59,130,246,.12); color: var(--info); }
.badge-completed { background: rgba(34,197,94,.12); color: var(--success); }
.badge-overdue { background: rgba(239,68,68,.12); color: var(--danger); }

/* ── FILTER BAR ────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.filter-chip {
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  font-size: .8rem; cursor: pointer; transition: var(--transition);
  font-family: inherit;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent-light); }
.filter-chip.active {
  background: rgba(99,102,241,.15);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px; width: 90%; max-width: 520px;
  max-height: 85dvh; overflow-y: auto;
  box-shadow: var(--shadow);
  animation: popIn .35s ease;
}
.modal h2 { font-size: 1.2rem; margin-bottom: 20px; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── FORM ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: .82rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  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: .88rem; font-family: inherit;
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── STATS GRID ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(99,102,241,.2); }
.stat-card .stat-label { font-size: .78rem; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-sub { font-size: .78rem; color: var(--text-secondary); margin-top: 4px; }

/* ── PERFORMANCE ───────────────────────────────── */
.perf-bar-container { margin-top: 8px; }
.perf-bar-bg {
  height: 8px; background: var(--bg-input);
  border-radius: 4px; overflow: hidden;
}
.perf-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width .8s ease;
}
.perf-user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 12px;
  transition: var(--transition);
}
.perf-user-card:hover { border-color: rgba(99,102,241,.2); }
.perf-user-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.perf-user-name { font-weight: 600; font-size: 1rem; }
.perf-stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px,1fr));
  gap: 10px; margin-top: 12px;
}
.perf-stat { text-align: center; }
.perf-stat .num { font-size: 1.3rem; font-weight: 700; }
.perf-stat .lbl { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; }

/* ── MEMBERS LIST ──────────────────────────────── */
.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
  transition: var(--transition);
}
.member-card:hover { border-color: rgba(99,102,241,.2); }
.member-info { display: flex; align-items: center; gap: 12px; }
.member-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #fff;
}
.member-name { font-weight: 600; }
.member-email { font-size: .8rem; color: var(--text-muted); }
.member-link {
  font-size: .75rem; color: var(--accent-light);
  word-break: break-all; max-width: 240px;
}

/* ── TOAST ─────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); font-size: .85rem;
  box-shadow: var(--shadow); min-width: 260px;
  animation: slideInRight .3s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── EMPTY STATE ───────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: .85rem; }

/* ── UNAUTHORIZED ──────────────────────────────── */
.unauthorized {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 80dvh; text-align: center; padding: 40px;
}
.unauthorized .icon { font-size: 4rem; margin-bottom: 16px; }
.unauthorized h1 { font-size: 1.5rem; margin-bottom: 8px; }
.unauthorized p { color: var(--text-secondary); font-size: .9rem; }

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 640px) {
  .app-header { padding: 12px 16px; }
  .nav-tabs { padding: 6px 16px; }
  .main-content { padding: 16px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 20px; width: 95%; }
  .member-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .task-header { flex-direction: column; }
  .task-actions { align-self: flex-end; }
}

/* ── CHECKBOX ANIMATION ────────────────────────── */
.task-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--text-muted);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: transparent;
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked {
  background: var(--success); border-color: var(--success);
  animation: checkPop .3s ease;
}
@keyframes checkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.task-check.checked::after {
  content: '✓'; color: #fff; font-size: .75rem; font-weight: 700;
}

/* ── SKELETON ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── SEARCH ────────────────────────────────────── */
.search-box {
  position: relative; flex: 1; max-width: 320px;
}
.search-box input {
  width: 100%; padding: 8px 14px 8px 36px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: .85rem; font-family: inherit;
  transition: var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box .search-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
  font-size: .85rem; pointer-events: none;
}

/* ── PULSE DOT ─────────────────────────────────── */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}
