/* B2C 電商平台期末提案 - 正式白底響應式樣式表 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ===== CSS 變數 ===== */
:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-code: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #4f46e5;
  --text-primary: #0f172a;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --accent-indigo: #4f46e5;
  --accent-violet: #7c3aed;
  --accent-teal: #0d9488;
  --accent-gold: #d97706;
  --accent-rose: #e11d48;
  --accent-success: #059669;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===== 基礎重置 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ===== 頁首 Header ===== */
header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-section { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.logo-badge {
  background: var(--text-primary);
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 800; color: white; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.header-titles h1 {
  font-size: 1.05rem; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.01em; line-height: 1.3;
}
.header-titles p { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ===== 分頁導覽 ===== */
nav.tab-navigation {
  display: flex; gap: 0.2rem;
  background: var(--bg-page);
  padding: 0.3rem; border-radius: 10px;
  border: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.nav-tab-btn {
  background: transparent; border: none;
  color: var(--text-muted); padding: 0.55rem 1rem;
  font-size: 0.85rem; font-weight: 600; border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; transition: var(--transition);
  display: flex; align-items: center; gap: 0.35rem; font-family: var(--font-sans);
}
.nav-tab-btn:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.nav-tab-btn.active {
  color: white;
  background: var(--accent-indigo);
  box-shadow: var(--shadow-sm);
}

/* ===== 主要內容區 ===== */
main {
  flex: 1; padding: 1.5rem;
  max-width: 1600px; width: 100%; margin: 0 auto;
}
.tab-panel { display: none; animation: tabIn 0.3s ease forwards; }
.tab-panel.active { display: block; }
@keyframes tabIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Tab 1：投影片簡報 ===== */
.presentation-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  height: calc(100vh - 160px);
  min-height: 560px;
}

.slide-sidebar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: flex; flex-direction: column;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.sidebar-search-box { padding: 0.875rem; border-bottom: 1px solid var(--border); }
.sidebar-search-box input {
  width: 100%; padding: 0.55rem 0.875rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-page); color: var(--text-primary);
  font-size: 0.82rem; transition: var(--transition); font-family: var(--font-sans);
}
.sidebar-search-box input::placeholder { color: var(--text-muted); }
.sidebar-search-box input:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.slide-sidebar-list {
  flex: 1; overflow-y: auto; padding: 0.5rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.slide-list-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.875rem; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent; transition: var(--transition);
}
.slide-list-item:hover { background: #f8fafc; border-color: var(--border); }
.slide-list-item.active { background: #eef2ff; border-color: #c7d2fe; }
.slide-num {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.7rem;
  color: var(--accent-indigo); background: #eef2ff;
  padding: 0.15rem 0.4rem; border-radius: 4px; flex-shrink: 0;
}
.slide-info { display: flex; flex-direction: column; min-width: 0; }
.slide-title {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slide-speaker { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

.slide-viewer {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  position: relative; box-shadow: var(--shadow-md);
}
.slide-viewer-header {
  padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: #fafbfc; flex-wrap: wrap; gap: 0.5rem;
}
.presentation-controls-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.control-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.control-item label { white-space: nowrap; }
.control-item select {
  background: white; border: 1px solid var(--border); color: var(--text-primary);
  padding: 0.3rem 0.6rem; border-radius: var(--radius-sm);
  font-size: 0.8rem; outline: none; font-family: var(--font-sans);
}
.btn-icon-only {
  background: white; border: 1px solid var(--border); color: var(--text-muted);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.btn-icon-only:hover { border-color: var(--accent-indigo); color: var(--accent-indigo); }

.slide-viewer-screen {
  flex: 1; padding: 3rem;
  overflow-y: auto; transition: opacity 0.2s ease;
  background: #ffffff;
}
.slide-content-wrapper { max-width: 860px; margin: 0 auto; }

.slide-show-header {
  margin-bottom: 2rem; padding-bottom: 1.25rem;
  border-bottom: 3px solid var(--accent-indigo);
}
#slide-show-title {
  font-size: 1.85rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.025em; line-height: 1.25;
}
#slide-show-subtitle { font-size: 1.05rem; color: var(--accent-teal); margin-top: 0.5rem; font-weight: 500; }
.slide-show-meta { margin-top: 0.875rem; }
#slide-show-speaker { font-size: 0.85rem; color: var(--text-muted); }
#slide-show-speaker strong {
  color: var(--text-primary); background: #f1f5f9;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-sm); margin-left: 0.25rem; font-weight: 600;
}

.slide-show-body { margin-top: 1.75rem; }
#slide-show-bullets { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
#slide-show-bullets li {
  font-size: 1rem; line-height: 1.7; color: var(--text-secondary);
  position: relative; padding-left: 1.5rem;
}
#slide-show-bullets li::before {
  content: '▸'; position: absolute; left: 0; top: 0.05rem;
  color: var(--accent-indigo); font-size: 0.9rem;
}
.highlight-gold { color: #b45309; font-weight: 700; }
.highlight-tech {
  color: var(--accent-teal); background: #f0fdfa;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.88rem; border: 1px solid #ccfbf1;
}
.slide-show-footer {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.slide-tag {
  background: #f1f5f9; border: 1px solid var(--border);
  padding: 0.25rem 0.65rem; border-radius: 20px;
  font-size: 0.72rem; color: var(--text-muted); font-weight: 500;
}
.slide-viewer-footer {
  padding: 0.875rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: #fafbfc; flex-wrap: wrap; gap: 0.75rem;
}
.presentation-controls-bottom { display: flex; align-items: center; gap: 0.5rem; }
.btn-ctrl {
  background: white; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 0.55rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.85rem; cursor: pointer;
  transition: var(--transition); font-family: var(--font-sans);
}
.btn-ctrl:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-autoplay { color: var(--accent-indigo); border-color: #c7d2fe; }
.btn-autoplay:hover { background: var(--accent-indigo); color: white; border-color: var(--accent-indigo); }
.btn-autoplay-active { background: var(--accent-rose) !important; border-color: var(--accent-rose) !important; color: white !important; }
.slide-page-indicator { font-family: var(--font-mono); font-weight: 600; font-size: 0.85rem; color: var(--text-muted); }
.slide-progress-bar { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: var(--border); }
#progress-fill {
  height: 100%; width: 0%;
  background: var(--accent-indigo);
  transition: width 0.3s ease;
}

/* ===== Tab 2：資料庫架構 ===== */
.db-tab-container { display: flex; flex-direction: column; gap: 1.5rem; }
.er-diagram-viewer {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.er-diagram-title { margin-bottom: 1.25rem; }
.er-diagram-title h3 { font-size: 1.05rem; font-weight: 700; }
.er-diagram-title p { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }
.er-diagram-map {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 0.875rem;
  background: #f8fafc; padding: 1.5rem;
  border-radius: var(--radius-md); border: 1px solid var(--border);
}
.schema-node {
  background: white; border: 1.5px solid var(--border);
  padding: 0.55rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem;
  color: var(--text-secondary); cursor: pointer;
  transition: var(--transition); box-shadow: var(--shadow-xs);
}
.schema-node:hover, .schema-node.active-node {
  border-color: var(--accent-indigo); color: var(--accent-indigo);
  background: #eef2ff; box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.schema-node.related-node { border-color: var(--accent-teal); color: var(--accent-teal); background: #f0fdfa; }
.schema-node.dimmed-node { opacity: 0.35; }
.er-connector { font-size: 0.8rem; color: #94a3b8; user-select: none; }

.db-tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; }
.table-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-indigo);
  border-radius: var(--radius-lg); padding: 1.25rem;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: var(--transition);
}
.table-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.table-card.highlighted-table { box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }
.table-card.related-table { border-left-color: var(--accent-teal); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }
.table-card.dimmed-table { opacity: 0.3; }
.table-card-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.table-icon { font-size: 1.2rem; }
.table-name-title { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; }
.table-desc-subtitle { font-size: 0.72rem; color: var(--text-muted); }
.columns-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.columns-table th {
  color: var(--text-muted); font-weight: 600; font-size: 0.7rem;
  padding: 0.35rem 0.25rem; border-bottom: 2px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.columns-table td { padding: 0.4rem 0.25rem; border-bottom: 1px solid #f1f5f9; }
.table-col-row strong { font-family: var(--font-mono); }
.col-type { font-family: var(--font-mono); color: var(--accent-teal); }
.col-desc { color: var(--text-muted); font-size: 0.75rem; }
.col-key {
  font-size: 0.62rem; font-weight: 800; padding: 0.1rem 0.3rem;
  border-radius: 3px; display: inline-block; vertical-align: middle; margin-right: 0.2rem;
}
.pk-badge { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.fk-badge { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.uq-badge { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.table-note-box {
  background: #f8fafc; border: 1px solid var(--border);
  padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.73rem; line-height: 1.45; color: var(--text-muted); margin-top: auto;
}
.table-note-box strong { color: #b45309; }
.sql-ddl-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1rem;
}
.sql-header-area { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.sql-header-area h3 { font-size: 1rem; font-weight: 700; }
.sql-code-container {
  background: var(--bg-code); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.25rem;
  overflow-x: auto; max-height: 380px;
}
.sql-code-container pre { font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.55; color: #1e293b; }

/* ===== Tab 3：規範檢核 ===== */
.checklist-container { max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.checklist-intro-card {
  background: #f8fafc;
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem;
}
.checklist-intro-card h3 { margin-bottom: 0.5rem; font-size: 1.05rem; }
.checklist-intro-card p { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.55; }
.checklist-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-success);
  border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.checklist-item:hover { box-shadow: var(--shadow-sm); }
.checklist-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.checklist-title-area { display: flex; align-items: center; gap: 0.6rem; }
.chk-status-icon {
  width: 22px; height: 22px; background: #d1fae5; border: 1px solid #6ee7b7;
  color: var(--accent-success); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: bold; flex-shrink: 0;
}
.chk-title { font-size: 1rem; font-weight: 700; }
.chk-badge { font-size: 0.68rem; font-weight: 800; padding: 0.2rem 0.55rem; border-radius: 5px; text-transform: uppercase; }
.badge-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.chk-text { font-size: 0.87rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.875rem; }
.chk-slides-map {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  background: #f8fafc; padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.chk-lbl { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.req-slide-badge {
  background: #eef2ff; border: 1px solid #c7d2fe; color: var(--accent-indigo);
  padding: 0.2rem 0.5rem; border-radius: 5px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.req-slide-badge:hover { background: var(--accent-indigo); color: white; }

/* ===== Tab 4：團隊分工 ===== */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.25rem; }
.team-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 1rem;
  transition: var(--transition);
}
.team-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.team-card-header { display: flex; align-items: center; gap: 0.875rem; }
.avatar-circle {
  width: 46px; height: 46px;
  background: var(--text-primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800; color: white; flex-shrink: 0;
}
.member-name { font-size: 1rem; font-weight: 700; }
.member-role { font-size: 0.78rem; color: var(--accent-teal); font-weight: 600; margin-top: 0.15rem; }
.team-card-body { display: flex; flex-direction: column; gap: 0.875rem; font-size: 0.84rem; }
.team-card-body h5 {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding-left: 0.5rem; border-left: 2px solid var(--accent-indigo); margin-bottom: 0.3rem;
}
.member-topics { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.member-topics li {
  padding-left: 0.875rem; position: relative;
  color: var(--text-secondary); line-height: 1.45;
}
.member-topics li::before { content: '•'; position: absolute; left: 0; color: var(--accent-violet); font-weight: bold; }
.member-tech { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tech-tag {
  background: #f1f5f9; border: 1px solid var(--border);
  padding: 0.2rem 0.5rem; border-radius: 5px;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent-teal); font-weight: 600;
}

/* ===== 頁尾 ===== */
footer.app-footer {
  text-align: center; padding: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted); background: var(--bg-card);
}

/* ===== 響應式 - 平板 (≤ 1100px) ===== */
@media (max-width: 1100px) {
  .presentation-container { grid-template-columns: 240px 1fr; }
}

/* ===== 響應式 - 小平板 (≤ 900px) ===== */
@media (max-width: 900px) {
  .presentation-container { grid-template-columns: 1fr; height: auto; min-height: unset; }
  .slide-sidebar { height: 220px; }
  .slide-viewer { min-height: 480px; }
  .db-tables-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .checklist-container { max-width: 100%; }
}

/* ===== 響應式 - 手機 (≤ 768px) ===== */
@media (max-width: 768px) {
  header { flex-direction: column; align-items: flex-start; padding: 0.875rem 1rem; }
  nav.tab-navigation { width: 100%; }
  main { padding: 0.875rem; }
  .slide-viewer-screen { padding: 1.5rem; }
  #slide-show-title { font-size: 1.35rem; }
  #slide-show-bullets li { font-size: 0.92rem; }
  .slide-viewer-footer { flex-direction: column; align-items: stretch; }
  .presentation-controls-bottom { justify-content: center; }
  .slide-page-indicator { text-align: center; }
  .er-diagram-map { padding: 1rem; gap: 0.5rem; }
  .sql-header-area { flex-direction: column; align-items: flex-start; }
}

/* ===== 響應式 - 小手機 (≤ 480px) ===== */
@media (max-width: 480px) {
  .logo-badge { width: 36px; height: 36px; font-size: 0.82rem; }
  .header-titles h1 { font-size: 0.9rem; }
  .header-titles p { display: none; }
  .nav-tab-btn { padding: 0.45rem 0.65rem; font-size: 0.78rem; }
  #slide-show-title { font-size: 1.15rem; }
  .slide-viewer-screen { padding: 1rem; }
  .btn-ctrl { padding: 0.45rem 0.75rem; font-size: 0.8rem; }
  .er-diagram-map { flex-direction: column; align-items: flex-start; }
  .schema-node { font-size: 0.75rem; }
  .control-item label { display: none; }
}

/* ===== 甘特圖分頁樣式 ===== */
.gantt-panel-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.gantt-intro-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.gantt-intro-title h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.gantt-intro-title p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.gantt-toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.gantt-filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.filter-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}
.filter-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.btn-filter-tag {
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.btn-filter-tag:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}
.btn-filter-tag.active {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: white;
  box-shadow: var(--shadow-xs);
}

.gantt-chart-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gantt-timeline-header, .gantt-timeline-days, .gantt-row-item {
  display: grid;
  grid-template-columns: 320px minmax(1050px, 1fr);
  align-items: center;
}

.task-info-spacer {
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
  background: #fafbfc;
}

.timeline-weeks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  height: 100%;
}
.week-hdr {
  padding: 0.75rem;
  border-right: 1px solid var(--border);
  background: #f8fafc;
}
.week-hdr:last-child {
  border-right: none;
}

.gantt-timeline-days {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.days-columns-grid {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  height: 100%;
}
.timeline-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0;
  font-family: var(--font-mono);
  border-right: 1px solid #f1f5f9;
}
.timeline-day-col:last-child {
  border-right: none;
}
.day-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
}
.date-lbl {
  font-size: 0.58rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
}

.gantt-rows-container {
  display: flex;
  flex-direction: column;
}
.gantt-row-item {
  border-bottom: 1px solid var(--border);
  height: 52px;
}
.gantt-row-item:last-child {
  border-bottom: none;
}
.gantt-task-info {
  padding: 0.4rem 1.25rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  height: 100%;
  background: #fafbfc;
  min-width: 0;
}
.task-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.gantt-member-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 3px;
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
}
.gantt-task-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}
.gantt-duration {
  font-family: var(--font-mono);
}

.gantt-task-timeline {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  align-items: center;
}
.gantt-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  pointer-events: none;
}
.gantt-grid-line {
  border-right: 1px solid #f1f5f9;
  height: 100%;
}
.gantt-grid-line:last-child {
  border-right: none;
}

/* Gantt Bar style spans across grid columns */
.gantt-progress-bar-span {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  position: relative;
  z-index: 5;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  overflow: hidden;
}
.gantt-progress-bar-span:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  filter: brightness(1.05);
}
.bar-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Color palettes for groups */
.bar-group-leader { background: linear-gradient(135deg, var(--accent-indigo), #6366f1); }
.bar-member-a { background: linear-gradient(135deg, var(--accent-teal), #14b8a6); }
.bar-member-b { background: linear-gradient(135deg, var(--accent-violet), #a855f7); }
.bar-member-c { background: linear-gradient(135deg, var(--accent-rose), #f43f5e); }
.bar-member-d { background: linear-gradient(135deg, var(--accent-gold), #f59e0b); }
.bar-member-e { background: linear-gradient(135deg, #0284c7, #38bdf8); }

/* Tooltip popup logic on hover */
.gantt-progress-bar-span .bar-tooltip-pop {
  visibility: hidden;
  width: 260px;
  background-color: #0f172a;
  color: #fff;
  text-align: left;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  position: absolute;
  z-index: 100;
  bottom: 125%; /* Position the tooltip above the bar */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.gantt-progress-bar-span .bar-tooltip-pop::after {
  content: "";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}
.gantt-progress-bar-span:hover .bar-tooltip-pop {
  visibility: visible;
  opacity: 1;
}

.gantt-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 100%;
}

