/* ============================================================
   PROJECT PLANNER — Design System
   ============================================================ */

/* === TOKENS === */
:root {
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;

  --gray-0:   #ffffff;
  --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;

  --green-100: #dcfce7; --green-600: #16a34a; --green-700: #15803d;
  --blue-100:  #dbeafe; --blue-600:  #2563eb; --blue-700:  #1d4ed8;
  --violet-100:#ede9fe; --violet-600:#7c3aed; --violet-700:#6d28d9;
  --amber-100: #fef3c7; --amber-600: #d97706; --amber-700: #b45309;
  --orange-100:#ffedd5; --orange-600:#ea580c; --orange-700:#c2410c;
  --red-100:   #fee2e2; --red-600:   #dc2626; --red-700:   #b91c1c;

  --surface-app:     var(--gray-50);
  --surface-card:    var(--gray-0);
  --surface-sidebar: var(--gray-900);

  --text-primary:       var(--gray-900);
  --text-secondary:     var(--gray-500);
  --text-muted:         var(--gray-400);
  --text-on-dark:       var(--gray-0);
  --text-on-dark-muted: #94a3b8;

  --border:        var(--gray-200);
  --border-strong: var(--gray-300);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);

  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --sidebar-width: 240px;
  --topbar-height: 60px;
  --transition: 150ms cubic-bezier(.4,0,.2,1);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); color: var(--text-primary); background: var(--surface-app); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, svg { display: block; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.25; }

/* === APP SHELL === */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
  background: var(--surface-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
}

.sidebar-logo-mark {
  width: 32px; height: 32px;
  background: var(--brand-500);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text { font-size: 15px; font-weight: 700; color: var(--text-on-dark); letter-spacing: -.3px; }

.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-on-dark-muted);
  padding: 14px 8px 6px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-on-dark-muted);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: var(--text-on-dark); }
.nav-link--active { background: rgba(99,102,241,.25); color: #a5b4fc; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-text { flex: 1; }
.nav-badge { background: var(--brand-600); color: #fff; border-radius: var(--radius-full); font-size: 10px; font-weight: 700; padding: 1px 6px; }

.sidebar-user {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px;
}
.sidebar-user-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}
.sidebar-user-link:hover { background: rgba(255,255,255,.07); }
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name  { font-size: 13px; font-weight: 600; color: var(--text-on-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: var(--text-on-dark-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === AVATAR === */
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar--lg { width: 48px; height: 48px; font-size: 18px; }
.avatar--xl { width: 64px; height: 64px; font-size: 24px; }

/* === MAIN AREA === */
.app-main { display: flex; flex-direction: column; overflow: hidden; background: var(--surface-app); }

/* === TOPBAR === */
.topbar {
  height: var(--topbar-height);
  background: var(--surface-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  flex-shrink: 0;
  position: relative; z-index: 20;
}

.topbar-search { flex: 1; max-width: 400px; position: relative; }
.topbar-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }

.topbar-search input {
  width: 100%; height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--gray-50);
  font-size: 13.5px; color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.topbar-search input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,102,241,.15); background: var(--gray-0); }
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Notification Bell */
.notif-wrapper { position: relative; }
.notif-btn {
  position: relative; width: 36px; height: 36px;
  border: none; background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.notif-btn:hover { background: var(--gray-100); color: var(--text-primary); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: #ef4444; border-radius: var(--radius-full);
  border: 2px solid var(--surface-card);
  font-size: 9px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Notification Dropdown */
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  overflow: hidden;
}
.notif-dropdown-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.notif-dropdown-title  { font-size: 14px; font-weight: 600; }
.notif-dropdown-item   { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
.notif-dropdown-item:hover { background: var(--gray-50); }
.notif-dropdown-item.unread { background: var(--brand-50); }
.notif-dropdown-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--brand-500); flex-shrink: 0; margin-top: 6px; }
.notif-dot.read { background: var(--gray-300); }
.notif-dropdown-msg  { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.notif-dropdown-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-dropdown-footer { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); }
.notif-dropdown-footer a { font-size: 13px; color: var(--brand-600); font-weight: 500; }
.notif-dropdown-footer a:hover { color: var(--brand-700); }
.notif-dropdown-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.hidden { display: none !important; }

/* === CONTENT AREA === */
.content { flex: 1; overflow-y: auto; }

/* === PAGE HEADER === */
.page-header { padding: 24px 32px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header-left { min-width: 0; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.page-subtitle { font-size: 13.5px; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.page-body { padding: 20px 32px 40px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
}
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn--primary { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.btn--primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn--secondary { background: var(--gray-0); color: var(--text-primary); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn--ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn--ghost:hover { background: var(--gray-100); color: var(--text-primary); }
.btn--danger { background: var(--red-600); color: #fff; border-color: var(--red-600); }
.btn--danger:hover { background: var(--red-700); }
.btn--danger-ghost { background: transparent; color: var(--red-600); border-color: transparent; }
.btn--danger-ghost:hover { background: var(--red-100); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: var(--radius-sm); }
.btn--lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }

/* === BADGES === */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.badge--gray   { background: var(--gray-100);   color: var(--gray-600); }
.badge--blue   { background: var(--blue-100);   color: var(--blue-700); }
.badge--green  { background: var(--green-100);  color: var(--green-700); }
.badge--amber  { background: var(--amber-100);  color: var(--amber-700); }
.badge--orange { background: var(--orange-100); color: var(--orange-700); }
.badge--red    { background: var(--red-100);    color: var(--red-700); }
.badge--violet { background: var(--violet-100); color: var(--violet-700); }

/* === PRIORITY === */
.priority-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-full); }
.priority--low    { background: #dcfce7; color: #16a34a; }
.priority--medium { background: #fef3c7; color: #d97706; }
.priority--high   { background: #ffedd5; color: #ea580c; }
.priority--urgent { background: #fee2e2; color: #dc2626; }
.priority--none   { display: none; }

/* === DUE LABEL === */
.due-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.due-label--overdue { color: var(--red-600); font-weight: 600; }
.due-label--today   { color: var(--amber-600); font-weight: 600; }

/* === CARDS === */
.card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.card-title  { font-size: 14px; font-weight: 600; }
.card-body   { padding: 16px 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

/* Project card */
.project-card {
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.project-card-accent { height: 4px; width: 100%; flex-shrink: 0; }
.project-card-body { padding: 16px 18px 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.project-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.project-card-desc  { font-size: 13px; color: var(--text-secondary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.project-card-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.project-card-footer { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--gray-50); }
.project-card-task-count { font-size: 12px; color: var(--text-secondary); }
.project-card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.project-card:hover .project-card-actions { opacity: 1; }

/* === PROJECTS GRID === */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* === FILTER BAR === */
.filter-bar { display: flex; align-items: center; gap: 4px; padding: 0 32px; margin-top: 16px; flex-wrap: wrap; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  background: transparent; cursor: pointer; text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.filter-btn:hover { background: var(--gray-100); color: var(--text-primary); }
.filter-btn.active { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); font-weight: 600; }
.filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--gray-200); color: var(--gray-600); border-radius: var(--radius-full); font-size: 11px; font-weight: 700; }
.filter-btn.active .filter-count { background: var(--brand-100); color: var(--brand-600); }
.filter-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.sort-bar { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-label { font-size: 12px; color: var(--text-muted); }
.sort-select { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 12.5px; color: var(--text-primary); background: var(--gray-0); cursor: pointer; outline: none; }
.sort-select:focus { border-color: var(--brand-500); }

/* === TASK LIST === */
.task-list { display: flex; flex-direction: column; }
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--surface-card);
  transition: background var(--transition);
  min-height: 52px;
}
.task-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.task-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.task-row:only-child  { border-radius: var(--radius-lg); }
.task-row:hover { background: var(--gray-50); }
.task-row-main { flex: 1; min-width: 0; }
.task-row-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-title a { color: inherit; }
.task-row-title a:hover { color: var(--brand-600); }
.task-row--completed .task-row-title { text-decoration: line-through; color: var(--text-muted); }
.task-row-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.task-row-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.status-select { appearance: none; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; cursor: pointer; outline: none; background: var(--gray-0); transition: border-color var(--transition); }
.status-select:focus { border-color: var(--brand-500); }

/* === TASK DETAIL === */
.task-detail { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.task-detail-main { min-width: 0; }
.task-detail-sidebar { display: flex; flex-direction: column; gap: 16px; }
.task-title-display { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.task-description-display { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-top: 12px; white-space: pre-wrap; }
.detail-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.detail-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.detail-value { font-size: 13.5px; color: var(--text-primary); }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0 10px 16px; border-left: 2px solid var(--gray-200); margin-left: 8px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--brand-500); border: 2px solid var(--surface-card); }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-text { font-size: 13px; color: var(--text-primary); }
.timeline-time { font-size: 11px; color: var(--text-muted); }

/* === PROGRESS BAR === */
.progress-track { height: 6px; background: var(--gray-200); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: var(--brand-500); transition: width .6s cubic-bezier(.4,0,.2,1); }
.progress-fill--green { background: var(--green-600); }
.progress-fill--amber { background: var(--amber-600); }
.progress-fill--red   { background: var(--red-600); }
.progress-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.progress-label-text { font-size: 12px; color: var(--text-secondary); }
.progress-label-pct  { font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* === DASHBOARD === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-icon--blue   { background: var(--blue-100); }
.stat-icon--green  { background: var(--green-100); }
.stat-icon--violet { background: var(--violet-100); }
.stat-icon--red    { background: var(--red-100); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--text-secondary); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-top: 20px; }

/* === KANBAN === */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.kanban-col { min-width: 240px; max-width: 280px; flex-shrink: 0; display: flex; flex-direction: column; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--gray-100); border: 1px solid var(--border); border-bottom: none; }
.kanban-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kanban-col-count { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--gray-200); border-radius: var(--radius-full); padding: 1px 7px; }
.kanban-cards { display: flex; flex-direction: column; gap: 6px; min-height: 80px; padding: 8px; background: var(--gray-100); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kanban-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; transition: box-shadow var(--transition), border-color var(--transition); display: flex; flex-direction: column; gap: 6px; }
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kanban-card.dragging { opacity: .5; }
.kanban-col.drag-over .kanban-cards { background: var(--brand-50); border-color: var(--brand-100); }
.kanban-card-title { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.kanban-card-meta  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* === FORMS === */
.form-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); max-width: 680px; margin: 24px auto; overflow: hidden; }
.form-card-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.form-card-title { font-size: 18px; font-weight: 700; }
.form-card-body { padding: 24px; }
.form-card-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--gray-50); display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.field input, .field select, .field textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); font-size: 14px; color: var(--text-primary); background: var(--gray-0); outline: none; transition: border-color var(--transition), box-shadow var(--transition); }
.field textarea { height: auto; min-height: 100px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.errors-box { background: var(--red-100); border: 1px solid #fca5a5; border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 18px; }
.errors-box h4 { font-size: 13px; font-weight: 600; color: var(--red-700); margin-bottom: 4px; }
.errors-box ul { list-style: disc; padding-left: 18px; }
.errors-box li { font-size: 13px; color: var(--red-700); }

/* Color Picker */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.color-swatch { width: 28px; height: 28px; border-radius: var(--radius-full); cursor: pointer; border: 3px solid transparent; transition: transform var(--transition), border-color var(--transition); }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--gray-900); transform: scale(1.1); }

/* === FLASH / TOAST === */
.flash-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; pointer-events: all; min-width: 280px; max-width: 380px; animation: slideIn .25s ease; border-left: 4px solid transparent; }
.flash--notice { background: var(--green-100); color: var(--green-700); border-left-color: var(--green-600); }
.flash--alert  { background: var(--red-100);   color: var(--red-700);   border-left-color: var(--red-600); }
.flash-msg   { flex: 1; }
.flash-close { background: none; border: none; cursor: pointer; color: inherit; opacity: .6; font-size: 18px; padding: 0; line-height: 1; flex-shrink: 0; }
.flash-close:hover { opacity: 1; }
@keyframes slideIn  { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:translateX(0); } }
@keyframes slideOut { from { opacity:1; transform:translateX(0); }  to { opacity:0; transform:translateX(24px); } }
.flash.dismissing { animation: slideOut .2s ease forwards; }

/* === EMPTY STATE === */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; }
.empty-state-icon  { font-size: 48px; margin-bottom: 16px; line-height: 1; }
.empty-state-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-body  { font-size: 14px; color: var(--text-secondary); max-width: 340px; line-height: 1.55; margin-bottom: 20px; }

/* === SECTION HEADER === */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title  { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* === TASK FORM DRAWER === */
.task-form-drawer { background: var(--gray-50); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 8px; }
.task-form-drawer .field { margin-bottom: 0; }
.task-form-drawer-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.task-form-drawer-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* === NOTIFICATIONS PAGE === */
.notif-list { display: flex; flex-direction: column; }
.notif-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); background: var(--surface-card); transition: background var(--transition); }
.notif-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.notif-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.notif-row:only-child  { border-radius: var(--radius-lg); }
.notif-row:hover { background: var(--gray-50); }
.notif-row.unread { background: var(--brand-50); }
.notif-row.unread:hover { background: var(--brand-100); }
.notif-row-icon { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--brand-100); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-row-body  { flex: 1; min-width: 0; }
.notif-row-msg   { font-size: 13.5px; color: var(--text-primary); line-height: 1.45; }
.notif-row-time  { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.notif-row-action { flex-shrink: 0; }

/* === PROFILE === */
.profile-header { display: flex; align-items: center; gap: 20px; padding: 24px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); margin-bottom: 20px; }
.profile-info h2 { font-size: 20px; font-weight: 700; }
.profile-info p  { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

/* === SEARCH PAGE === */
.search-group { margin-bottom: 28px; }
.search-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 4px; text-decoration: none; color: inherit; transition: background var(--transition), border-color var(--transition); }
.search-item:hover { background: var(--gray-50); border-color: var(--border-strong); }
.search-item-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-sub   { font-size: 12px; color: var(--text-muted); }
.search-item-main  { flex: 1; min-width: 0; }

/* === PROJECT SHOW === */
.project-show-header { display: flex; align-items: flex-start; gap: 16px; padding: 24px 32px 0; }
.project-color-dot { width: 14px; height: 14px; border-radius: var(--radius-full); flex-shrink: 0; margin-top: 6px; }
.project-show-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.project-show-desc  { font-size: 14px; color: var(--text-secondary); margin-top: 4px; max-width: 640px; line-height: 1.55; }
.project-show-meta  { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.project-show-progress { flex: 1; max-width: 240px; }

/* === TABS === */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin: 16px 32px 0; }
.tab-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px 10px; font-size: 13.5px; font-weight: 500; color: var(--text-secondary); border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; text-decoration: none; margin-bottom: -2px; transition: color var(--transition), border-color var(--transition); }
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand-600); border-bottom-color: var(--brand-500); font-weight: 600; }

/* === AUTH PAGES === */
body.auth-body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); overflow: hidden; }
.auth-card-header { padding: 28px 32px 20px; text-align: center; border-bottom: 1px solid var(--border); }
.auth-logo-mark { width: 48px; height: 48px; background: var(--brand-500); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; color: #fff; margin: 0 auto 12px; }
.auth-card-title    { font-size: 20px; font-weight: 700; }
.auth-card-subtitle { font-size: 13.5px; color: var(--text-secondary); margin-top: 4px; }
.auth-card-body   { padding: 24px 32px; }
.auth-card-footer { padding: 16px 32px 24px; text-align: center; border-top: 1px solid var(--border); background: var(--gray-50); }
.auth-card-footer p { font-size: 13.5px; color: var(--text-secondary); }
.auth-card-footer a { color: var(--brand-600); font-weight: 500; }
.auth-card-footer a:hover { color: var(--brand-700); }
.auth-submit { width: 100%; margin-top: 8px; }
.auth-flash { padding: 10px 16px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 16px; font-weight: 500; }
.auth-flash--notice { background: var(--green-100); color: var(--green-700); }
.auth-flash--alert  { background: var(--red-100); color: var(--red-700); }
.auth-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.auth-links a { font-size: 13px; color: var(--brand-600); }
.auth-links a:hover { color: var(--brand-700); }

/* === UTILITY === */
.text-sm { font-size: 13px; } .text-xs { font-size: 11.5px; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; } .text-center { text-align: center; }
.font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; } .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* === CARD VARIANTS === */
.card--padded { padding: 20px 24px; }
.card-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 14px; }

/* === BREADCRUMB === */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumb-link { color: var(--text-muted); }
.breadcrumb-link:hover { color: var(--brand-600); }
.breadcrumb-sep { color: var(--gray-300); }
.breadcrumb-current { color: var(--text-secondary); }

/* === TASK ROW (updated) === */
.task-row-drag { cursor: grab; color: var(--gray-300); font-size: 14px; padding: 0 2px; flex-shrink: 0; }
.task-row-drag:hover { color: var(--gray-400); }
.task-row-check { flex-shrink: 0; }
.task-check-btn {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-300); border-radius: var(--radius-full);
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: transparent;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  padding: 0;
}
.task-check-btn:hover { border-color: var(--brand-500); }
.task-check-btn--done { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.task-row-body { flex: 1; min-width: 0; }
.task-row-title-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.task-row-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); text-decoration: none; }
.task-row-title:hover { color: var(--brand-600); }
.task-row-title--done { text-decoration: line-through; color: var(--text-muted); }
.task-row-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); flex-shrink: 0; }
.task-row:hover .task-row-actions { opacity: 1; }

/* === TASK FORM DRAWER === */
.task-drawer-form { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow-md); }
.task-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid var(--border); }
.task-drawer-title { font-size: 15px; font-weight: 600; }
.task-drawer-close { font-size: 20px; color: var(--text-muted); line-height: 1; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); transition: background var(--transition); }
.task-drawer-close:hover { background: var(--gray-100); color: var(--text-primary); }
.task-drawer-body { padding: 14px 18px; }
.task-drawer-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--gray-50); display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

/* === TASK DETAIL (show page) === */
.task-detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.task-detail-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.65; white-space: pre-wrap; }
.task-meta-list { display: flex; flex-direction: column; gap: 0; }
.task-meta-list dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-top: 14px; }
.task-meta-list dt:first-child { margin-top: 0; }
.task-meta-list dd { font-size: 13.5px; color: var(--text-primary); margin-top: 3px; }
.status-actions { display: flex; flex-direction: column; gap: 4px; }
.btn--full { width: 100%; }

/* Status timeline */
.status-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0 10px 20px; border-left: 2px solid var(--gray-200); margin-left: 4px; position: relative; }
.timeline-dot { position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--brand-500); border: 2px solid var(--surface-card); flex-shrink: 0; }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-content { display: flex; flex-direction: column; gap: 3px; }
.timeline-change { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.timeline-arrow { font-size: 14px; color: var(--text-muted); }
.timeline-time { font-size: 11px; color: var(--text-muted); }

/* === NOTIFICATIONS PAGE === */
.notification-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--gray-100); background: var(--surface-card); transition: background var(--transition); }
.notification-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.notification-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.notification-row:only-child  { border-radius: var(--radius-lg); }
.notification-row:hover { background: var(--gray-50); }
.notification-row--unread { background: var(--brand-50); }
.notification-row--unread:hover { background: #e0e7ff; }
.notification-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--brand-500); flex-shrink: 0; margin-top: 6px; }
.notification-row:not(.notification-row--unread) .notification-dot { background: var(--gray-300); }
.notification-body { flex: 1; min-width: 0; }
.notification-message { font-size: 13.5px; color: var(--text-primary); line-height: 1.45; }
.notification-time { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.notification-read-btn {
  flex-shrink: 0; width: 26px; height: 26px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--gray-0); cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  padding: 0;
}
.notification-read-btn:hover { border-color: var(--green-600); color: var(--green-600); background: var(--green-100); }
.notification-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; color: var(--text-muted); gap: 8px; }
.notification-empty-icon { font-size: 40px; }
.notif-badge--active { min-width: 16px; height: 16px; }

/* === SEARCH PAGE === */
.search-page-bar { margin-bottom: 24px; }
.search-input-wrap { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; pointer-events: none; }
.search-input { width: 100%; height: 44px; padding: 0 40px 0 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); font-size: 15px; color: var(--text-primary); background: var(--surface-card); outline: none; box-shadow: var(--shadow-sm); transition: border-color var(--transition), box-shadow var(--transition); }
.search-input--lg { height: 50px; font-size: 16px; }
.search-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.search-clear-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-full); color: var(--text-muted); font-size: 18px; transition: background var(--transition); }
.search-clear-btn:hover { background: var(--gray-100); color: var(--text-primary); }
.search-section { margin-bottom: 28px; }
.search-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.search-section-count { background: var(--gray-200); color: var(--gray-600); border-radius: var(--radius-full); font-size: 11px; font-weight: 700; padding: 1px 7px; }
.search-hints { padding: 32px 0; }
kbd { background: var(--gray-100); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 1px 5px; font-size: 12px; font-family: inherit; color: var(--text-secondary); }

/* === PROFILE PAGE === */
.profile-card { }
.profile-avatar-section { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.profile-name-section { }
.profile-display-name { font-size: 20px; font-weight: 700; }
.profile-email { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.profile-stats { display: flex; gap: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.profile-stat { display: flex; flex-direction: column; gap: 2px; }
.profile-stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.profile-stat-label { font-size: 12px; color: var(--text-secondary); }
.profile-avatar-mini { display: flex; align-items: center; gap: 12px; }

/* === AUTH FORMS (updated structure) === */
.auth-header { padding: 28px 32px 20px; text-align: center; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 20px; }
.auth-logo-icon { font-size: 28px; }
.auth-logo-text { font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: var(--text-primary); }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); }
.auth-form { padding: 24px 32px; display: flex; flex-direction: column; gap: 0; }
.auth-form .field { margin-bottom: 16px; }
.auth-form .btn--full { margin-top: 8px; }
.auth-footer { padding: 16px 32px 24px; border-top: 1px solid var(--border); background: var(--gray-50); text-align: center; }
.field--checkbox { flex-direction: row; align-items: center; gap: 8px; }
.field--checkbox input { width: auto; height: auto; }

/* Danger Zone */
.danger-zone { border: 1px solid var(--red-600) !important; }
.danger-zone-title { font-size: 14px; font-weight: 700; color: var(--red-600); margin-bottom: 8px; }

/* Kanban additions */
.kanban-add-btn { font-size: 18px; color: var(--text-muted); line-height: 1; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: background var(--transition), color var(--transition); }
.kanban-add-btn:hover { background: var(--gray-200); color: var(--text-primary); }
.kanban-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.kanban-card-link { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.kanban-card-link:hover { color: var(--brand-600); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .task-detail { grid-template-columns: 1fr; }
  .task-detail-grid { grid-template-columns: 1fr; }
  .task-form-drawer-row { grid-template-columns: 1fr; }
  .page-header, .page-body { padding-left: 16px; padding-right: 16px; }
  .filter-bar { padding: 0 16px; }
  .tabs { margin-left: 16px; margin-right: 16px; }
  .project-show-header { padding-left: 16px; padding-right: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .auth-form, .auth-header, .auth-footer { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
