/* ==========================================
   Design System — Optima Style
   ========================================== */
:root {
  --sidebar-width: 224px;

  /* Sidebar — light */
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e7eb;
  --sidebar-text: #6b7280;
  --sidebar-hover-bg: #f9fafb;
  --sidebar-hover-text: #111827;
  --sidebar-active-bg: #f5f3ff;
  --sidebar-active-text: #7c3aed;
  --sidebar-active-bar: #7c3aed;
  --sidebar-label: #9ca3af;

  /* Body */
  --body-bg: #f0f2f5;

  /* Content */
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  /* Brand — purple */
  --brand: #7c3aed;
  --brand-hover: #6d28d9;
  --brand-light: #f5f3ff;
  --brand-mid: #ede9fe;

  /* Accents */
  --accent-blue: #3b82f6;
  --accent-blue-light: #eff6ff;

  /* Priority */
  --priority-high: #ef4444;
  --priority-high-bg: #fef2f2;
  --priority-medium: #f59e0b;
  --priority-medium-bg: #fffbeb;
  --priority-low: #10b981;
  --priority-low-bg: #ecfdf5;

  /* Radii */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);

  --transition: 0.15s ease;
}

/* ==========================================
   Reset & Base
   ========================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--body-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

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

/* ==========================================
   Sidebar — White
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.sidebar-brand .brand-icon {
  width: 30px;
  height: 30px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 4px 10px;
  margin-bottom: 4px;
}

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sidebar-label);
  padding: 8px 6px 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 1px;
  position: relative;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-hover-text);
}

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 500;
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--sidebar-active-bar);
  border-radius: 0 3px 3px 0;
}

.sidebar-nav a i {
  font-size: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-nav a.active i { opacity: 1; }

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition);
}

.sidebar-user:hover { background: var(--sidebar-hover-bg); }

.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-header .page-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-body {
  padding: 24px 28px;
  flex: 1;
  min-width: 0;
}

/* ==========================================
   Flash Messages
   ========================================== */
.flash-messages { padding: 0 28px; }

.alert {
  border-radius: var(--radius);
  border: none;
  padding: 10px 14px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: #eff6ff; color: #1e40af; }

/* ==========================================
   Cards
   ========================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}
.card-body { padding: 16px; }

/* ==========================================
   Buttons
   ========================================== */
.btn {
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  transition: all var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #fff;
}

.btn-outline-primary {
  color: var(--brand);
  border-color: #c4b5fd;
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border-color);
  background: transparent;
}
.btn-outline-secondary:hover {
  background: #f3f4f6;
  color: var(--text-primary);
}

.btn-outline-danger {
  color: var(--priority-high);
  border-color: #fecaca;
  background: transparent;
}
.btn-outline-danger:hover {
  background: var(--priority-high-bg);
}

.btn-outline-success {
  color: var(--priority-low);
  border-color: #a7f3d0;
  background: transparent;
}
.btn-outline-success:hover { background: var(--priority-low-bg); }

.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 5px;
}

.btn-danger  { background: var(--priority-high);   color: #fff; border-color: var(--priority-high); }
.btn-success { background: var(--priority-low);    color: #fff; border-color: var(--priority-low); }
.btn-warning { background: var(--priority-medium); color: #fff; border-color: var(--priority-medium); }
.btn-danger:hover { background: #dc2626; color: #fff; }

/* ==========================================
   Badges
   ========================================== */
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-priority-high   { background: var(--priority-high-bg);   color: var(--priority-high); }
.badge-priority-medium { background: var(--priority-medium-bg); color: #b45309; }
.badge-priority-low    { background: var(--priority-low-bg);    color: #047857; }

/* Priority flag icon style (like reference) */
.priority-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
}
.priority-flag .flag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================
   Filter Bar
   ========================================== */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
}
.filter-bar .form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

/* ==========================================
   Task Group Sections
   ========================================== */
.task-group-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.task-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
}

.group-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.group-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.group-count {
  font-size: 11.5px;
  font-weight: 600;
  background: #f3f4f6;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 20px;
}

.group-add-btn {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
}
.group-add-btn:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-mid);
}

/* ==========================================
   Task Table
   ========================================== */
.task-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.task-table thead th {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 9px 16px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.task-table tbody tr:last-child { border-bottom: none; }
.task-table tbody tr:hover { background: #f9fafb; }

.task-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--text-primary);
  overflow: hidden;
}

/* Completed row */
.task-table tr.task-completed td { opacity: 0.55; }
.task-table tr.task-completed .task-link { text-decoration: line-through; }

/* Checkbox */
.task-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--brand);
  border-radius: 4px;
}

/* Task ID */
.task-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Task link */
.task-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: color var(--transition);
}
.task-link:hover { color: var(--brand); }

/* Subtask count pill — clickable toggle */
.subtask-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.subtask-toggle-btn:hover {
  background: var(--brand-mid);
  color: var(--brand);
}
.subtask-toggle-btn .toggle-arrow {
  font-size: 9px;
  transition: transform 0.2s ease;
  display: inline-block;
}
.subtask-toggle-btn.expanded .toggle-arrow {
  transform: rotate(90deg);
}

/* Subtask rows in task list */
.subtask-list-row {
  display: none;
  background: #faf9ff;
  border-bottom: 1px solid #ede9fe;
}
.subtask-list-row.visible { display: table-row; }
.subtask-list-row:last-child { border-bottom: none; }
.subtask-list-row:hover { background: #f3f0ff; }

/* Inset left accent bar — spans the full visual height of the row */
.subtask-list-row td:first-child {
  box-shadow: inset 3px 0 0 #c4b5fd;
}

.subtask-list-row td {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* L-shaped tree connector before the subtask title */
.subtask-indent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
}
.subtask-indent::before {
  content: '';
  width: 18px;
  height: 16px;
  border-left: 1.5px solid #c4b5fd;
  border-bottom: 1.5px solid #c4b5fd;
  border-radius: 0 0 0 4px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 1px;
}

/* Keep the old class name for backwards compat */
.subtask-count {
  font-size: 11px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

/* Description cell */
.desc-cell {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Due date */
.due-overdue { color: var(--priority-high); font-weight: 600; }

/* ==========================================
   Circular Progress
   ========================================== */
.circular-progress-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.circular-progress-wrap .pct-label {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}

/* ==========================================
   Three-dot Menu
   ========================================== */
.row-menu-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.row-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
}
.task-table tbody tr:hover .row-menu-btn { opacity: 1; }
.row-menu-btn:hover { background: #f3f4f6; color: var(--text-primary); }
.row-menu-btn.open { opacity: 1; background: #f3f4f6; }

.row-dropdown {
  position: absolute;
  right: 0;
  top: 32px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 130px;
  z-index: 200;
  padding: 4px;
  display: none;
}
.row-dropdown.show { display: block; }

.row-dropdown a,
.row-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background var(--transition);
}
.row-dropdown a:hover { background: #f9fafb; }
.row-dropdown button:hover { background: #fef2f2; color: var(--priority-high); }

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 36px; margin-bottom: 10px; display: block; }
.empty-state p { margin: 0; font-size: 13.5px; }

/* ==========================================
   Forms
   ========================================== */
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 5px;
  display: block;
}
.form-control, .form-select {
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}
.form-control-sm, .form-select-sm {
  padding: 5px 9px;
  font-size: 12.5px;
  border-radius: 5px;
}
textarea.form-control { resize: vertical; min-height: 80px; }

.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }

/* ==========================================
   Detail Page
   ========================================== */
.detail-title {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0 12px;
  color: var(--text-primary);
}
.detail-title.completed { text-decoration: line-through; color: var(--text-muted); }

.detail-sidebar .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.detail-sidebar .info-row:last-child { border-bottom: none; }
.detail-sidebar .info-label { color: var(--text-muted); }
.detail-sidebar .info-value { font-weight: 500; color: var(--text-primary); }

/* Subtask */
.subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background var(--transition);
}
.subtask-item:hover { background: #f9fafb; }
.subtask-item .subtask-toggle {
  width: 14px; height: 14px;
  cursor: pointer;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.subtask-item .subtask-delete { opacity: 0; transition: opacity var(--transition); }
.subtask-item:hover .subtask-delete { opacity: 1; }

/* Status quick-switch pills */
.status-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.status-pill {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
}
.status-pill.active, .status-pill:hover { color: #fff !important; }

/* ==========================================
   Dashboard Stats
   ========================================== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-number { font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label  { font-size: 12.5px; color: var(--text-muted); }

/* ==========================================
   Login Page
   ========================================== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 50%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: block;
  margin: 0 auto 14px;
  object-fit: contain;
}
.login-logo h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ==========================================
   Utilities
   ========================================== */
.text-muted   { color: var(--text-muted)    !important; }
.text-primary { color: var(--text-primary)  !important; }
.text-success { color: var(--priority-low)  !important; }
.text-danger  { color: var(--priority-high) !important; }
.text-warning { color: var(--priority-medium) !important; }
.text-blue    { color: var(--accent-blue)   !important; }
.text-brand   { color: var(--brand)         !important; }

.divider { height: 1px; background: var(--border-color); margin: 16px 0; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.me-1 { margin-right: 4px; }
.ms-auto { margin-left: auto; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* Bootstrap grid shim */
.row { --bs-gutter-x: 16px; }

/* Override bootstrap navbar — not used */
.navbar { display: none; }

/* Table container */
.table { margin-bottom: 0; }

/* List group */
.list-group-item {
  border-color: var(--border-color);
  padding: 10px 16px;
  font-size: 13.5px;
}

/* ==========================================
   View Toggle Tabs (List / Kanban)
   ========================================== */
.view-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 3px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
}
.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.view-tab:hover {
  background: var(--sidebar-hover-bg);
  color: var(--text-primary);
  text-decoration: none;
}
.view-tab.active {
  background: var(--brand);
  color: #fff;
}
.view-tab.active:hover { color: #fff; }

/* ==========================================
   Kanban Board
   ========================================== */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}
/* Custom scrollbar for kanban */
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.kanban-column {
  flex: 0 0 272px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: sticky;
  top: 0;
}

.kanban-column-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.kanban-card {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: var(--radius);
  padding: 11px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  cursor: pointer;
}
.kanban-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  transform: translateY(-1px);
  border-color: #d4d4d8;
}

.kanban-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.kanban-card-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 9px;
  text-decoration: none;
  display: block;
}
.kanban-card-title:hover { color: var(--brand); }

.kanban-card.task-completed .kanban-card-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
.kanban-card.task-completed { opacity: 0.6; }

.kanban-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kanban-assignee {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  title: attr(title);
}

.kanban-due {
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kanban-due.overdue { color: var(--priority-high); font-weight: 600; }

.kanban-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.kanban-empty i { font-size: 22px; display: block; margin-bottom: 6px; opacity: .4; }

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
  :root { --sidebar-width: 200px; }
  .page-body { padding: 16px; }
  .page-header { padding: 12px 16px; }
  .desc-cell { display: none; }
}
@media (max-width: 576px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
}
