/* ============================================
   Task Management System - Main Stylesheet
   ============================================ */

:root {
  --primary: #667eea;
  --primary-dark: #5a6fd6;
  --secondary: #764ba2;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;
  --font-thai: 'Noto Sans Thai', sans-serif;
  --font-en: 'Inter', sans-serif;
  --bg-body: #f0f2f7;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --border-color: #e8ecf0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
body {
  font-family: var(--font-thai), var(--font-en);
  background: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}
.fw-500 { font-weight: 500; }

/* ============ SIDEBAR ============ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 70px;
}
.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon i { color: white; font-size: 18px; }
.brand-text { overflow: hidden; white-space: nowrap; }
.brand-name { display: block; color: white; font-weight: 700; font-size: 16px; }
.brand-sub  { display: block; color: rgba(255,255,255,0.4); font-size: 11px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.nav-section-title {
  color: rgba(255,255,255,0.3);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}
.sidebar.collapsed .nav-section-title { opacity: 0; height: 0; padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: 2px;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}
.nav-icon { width: 20px; flex-shrink: 0; text-align: center; font-size: 16px; }
.sidebar.collapsed .nav-item span:not(.badge) { display: none; }
.sidebar.collapsed .nav-item .badge { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
}
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-details { flex: 1; overflow: hidden; transition: all 0.2s; }
.user-name { color: white; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { margin-top: 2px; }
.badge-role { font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.badge-role.admin   { background: rgba(231,76,60,0.2);  color: #e74c3c; }
.badge-role.manager { background: rgba(243,156,18,0.2); color: #f39c12; }
.badge-role.member  { background: rgba(39,174,96,0.2);  color: #27ae60; }
.logout-btn { color: rgba(255,255,255,0.4); text-decoration: none; padding: 4px 6px; border-radius: 6px; transition: all 0.2s; display: flex; align-items: center; }
.logout-btn:hover { color: #e74c3c; background: rgba(231,76,60,0.15); }
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn { display: none; }

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* ============ TOPBAR ============ */
.topbar {
  background: var(--bg-card);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: var(--bg-body); color: var(--primary); }
.topbar-title { flex: 1; }
.page-title { font-size: 20px; font-weight: 700; margin: 0; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-content { flex: 1; }

/* ============ STAT CARDS ============ */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.bg-primary-soft { background: rgba(102,126,234,0.1); }
.bg-success-soft { background: rgba(39,174,96,0.1); }
.bg-warning-soft { background: rgba(243,156,18,0.1); }
.bg-danger-soft  { background: rgba(231,76,60,0.1); }
.bg-info-soft    { background: rgba(52,152,219,0.1); }

/* ============ CHART CARDS ============ */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  height: 100%;
}
.chart-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.chart-title { font-size: 15px; font-weight: 600; margin: 0; }
.chart-sub   { font-size: 12px; color: var(--text-secondary); margin: 2px 0 0; }
.chart-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.chart-body { padding: 16px; position: relative; height: 300px; }

/* ============ DATA CARDS ============ */
.data-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.data-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.data-card-title { font-size: 15px; font-weight: 600; margin: 0; }
.data-card-body  { padding: 16px; }

/* ============ WORKLOAD ============ */
.workload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.workload-item:last-child { border-bottom: none; }
.workload-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.workload-info { flex: 1; min-width: 0; }
.workload-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workload-progress { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.workload-pct { font-size: 12px; color: var(--text-secondary); min-width: 35px; text-align: right; }
.workload-stats { display: flex; align-items: center; flex-shrink: 0; gap: 4px; }

/* ============ OVERDUE ITEMS ============ */
.overdue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.overdue-item:hover { background: var(--bg-body); color: inherit; }
.overdue-item:last-child { border-bottom: none; }
.overdue-info { flex: 1; min-width: 0; }
.overdue-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overdue-meta  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.overdue-priority { flex-shrink: 0; }

/* ============ TASK CARDS (Grid) ============ */
.task-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.task-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.task-card.priority-critical { border-left-color: #e74c3c; }
.task-card.priority-high     { border-left-color: #f39c12; }
.task-card.priority-medium   { border-left-color: #3498db; }
.task-card.priority-low      { border-left-color: #27ae60; }

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.task-number { font-size: 11px; color: var(--text-secondary); font-family: 'Courier New', monospace; }
.task-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.task-title {
  font-size: 14px; font-weight: 600; margin-bottom: 8px;
  color: var(--text-primary); flex: 1; line-height: 1.4;
}
.task-category { font-size: 11px; font-weight: 500; margin-bottom: 8px; }
.task-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}
.task-assignee { display: flex; align-items: center; gap: 6px; }
.task-footer { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.task-progress-wrap { display: flex; align-items: center; gap: 8px; }
.task-actions { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-secondary); }
.task-comment-count { color: var(--primary); }
.badge-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.badge-sm { font-size: 10px !important; padding: 3px 7px !important; }
.badge-lg { font-size: 13px !important; padding: 5px 12px !important; }
.badge-category-lg {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

/* ============ TASK CARD HORIZONTAL ============ */
.task-card-h {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--border-color);
  display: flex;
  gap: 16px;
  transition: all 0.2s;
  height: 100%;
}
.task-card-h:hover { box-shadow: var(--shadow-md); }
.task-card-h.priority-critical { border-left-color: #e74c3c; }
.task-card-h.priority-high     { border-left-color: #f39c12; }
.task-card-h.priority-medium   { border-left-color: #3498db; }
.task-card-h.priority-low      { border-left-color: #27ae60; }
.task-card-h-left  { flex: 1; min-width: 0; }
.task-card-h-right {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-left: 1px solid var(--border-color);
  padding-left: 16px;
  flex-shrink: 0;
}
.task-title-link { font-size: 14px; font-weight: 600; color: var(--text-primary); text-decoration: none; display: block; }
.task-title-link:hover { color: var(--primary); }

/* ============ FILTER BAR ============ */
.filter-bar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.search-input-wrap { position: relative; }
.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.quick-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.qf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}
.qf-btn:hover { background: #e0e4ef; color: var(--text-primary); }
.qf-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ============ TASK DETAIL ============ */
.task-detail-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.task-detail-header { padding: 24px; border-bottom: 1px solid var(--border-color); }
.task-detail-body   { padding: 24px; }
.task-number-lg {
  font-size: 13px;
  font-family: monospace;
  color: var(--primary);
  background: rgba(102,126,234,0.08);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}
.task-detail-title { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.4; margin: 0; }
.detail-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.detail-content { color: var(--text-primary); line-height: 1.7; }
.outcome-box {
  background: rgba(39,174,96,0.05);
  border-left: 3px solid #27ae60;
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============ COMMENTS ============ */
.comments-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.comments-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.comments-title  { font-size: 15px; font-weight: 600; margin: 0; }
.comments-body   { padding: 20px; }
.comment-list    { display: flex; flex-direction: column; gap: 0; margin-bottom: 24px; }
.comment-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}
.comment-item:first-child { padding-top: 0; }
.comment-item:last-child { border-bottom: none; }
.comment-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-content { flex: 1; min-width: 0; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.comment-author { font-weight: 600; font-size: 14px; }
.comment-time   { font-size: 12px; color: var(--text-secondary); }
.comment-text   { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.comment-updates { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.update-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.progress-update { background: rgba(102,126,234,0.1); color: var(--primary); }
.comment-attachment { font-size: 12px; margin-top: 8px; }
.attachment-link { color: var(--primary); text-decoration: none; background: rgba(102,126,234,0.06); padding: 4px 10px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.attachment-link:hover { background: rgba(102,126,234,0.12); }
.add-comment {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  align-items: flex-start;
}
.comment-form { flex: 1; }
.empty-comments { text-align: center; padding: 32px 20px; color: var(--text-secondary); }

/* ============ INFO CARD (Sidebar) ============ */
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.info-card-header { padding: 14px 16px; border-bottom: 1px solid var(--border-color); }
.info-card-title  { font-size: 14px; font-weight: 600; margin: 0; }
.info-card-body   { padding: 16px; }
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { color: var(--text-secondary); min-width: 120px; flex-shrink: 0; display: flex; align-items: center; }
.info-value { flex: 1; font-weight: 500; min-width: 0; }

/* ============ FORM CARD ============ */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: 28px;
}
.form-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.form-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.form-card-title { font-size: 20px; font-weight: 700; margin: 0; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

/* ============ PRIORITY SELECTOR ============ */
.priority-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.priority-option {
  flex: 1;
  min-width: 70px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  background: var(--bg-body);
  color: var(--text-secondary);
  user-select: none;
}
.priority-option:hover { border-color: #aaa; }
.priority-option.priority-critical.selected { border-color: #e74c3c; background: rgba(231,76,60,0.08); color: #e74c3c; }
.priority-option.priority-high.selected     { border-color: #f39c12; background: rgba(243,156,18,0.08); color: #f39c12; }
.priority-option.priority-medium.selected   { border-color: #3498db; background: rgba(52,152,219,0.08); color: #3498db; }
.priority-option.priority-low.selected      { border-color: #27ae60; background: rgba(39,174,96,0.08); color: #27ae60; }

/* ============ NAVIGATION TABS ============ */
.nav-tabs-modern {
  border-bottom: 2px solid var(--border-color);
  gap: 4px;
}
.nav-tabs-modern .nav-link {
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -2px;
  padding: 10px 16px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-tabs-modern .nav-link:hover { color: var(--primary); border-bottom-color: rgba(102,126,234,0.3); }
.nav-tabs-modern .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: none; }

/* ============ TABLE ============ */
.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.table td { font-size: 13px; }
.table-hover tbody tr:hover { background: rgba(102,126,234,0.04); }

/* ============ EMPTY STATES ============ */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}
.empty-state i { font-size: 32px; margin-bottom: 12px; display: block; opacity: 0.5; }
.empty-state p { margin: 0; font-size: 14px; }
.empty-page {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

/* ============ BUTTONS ============ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: white;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #6a3d8f);
  color: white;
  box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* ============ FORM CONTROLS ============ */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* ============ PROGRESS BAR ============ */
.progress-section { }
.progress-bar { transition: width 0.6s ease; }

/* ============ SETTINGS ============ */
.settings-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow: hidden;
}
.settings-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(102,126,234,0.03);
}
.settings-section-title { font-size: 15px; font-weight: 600; margin: 0; }
.settings-section-body { padding: 24px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .task-card-h { flex-direction: column; }
  .task-card-h-right { border-left: none; border-top: 1px solid var(--border-color); padding-left: 0; padding-top: 12px; flex-direction: row; min-width: auto; width: 100%; justify-content: space-between; align-items: center; }
}
@media (max-width: 576px) {
  .topbar { padding: 0 12px; }
  .page-title { font-size: 16px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .form-card { padding: 16px; }
  .task-detail-header { padding: 16px; }
  .task-detail-body   { padding: 16px; }
}

/* ============ PRINT ============ */
@media print {
  .sidebar, .topbar, .topbar-actions, .form-actions { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .task-card { break-inside: avoid; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8cfd8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9aa5b4; }

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.3s ease forwards; }

/* ============ UTILITIES ============ */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}