/* ============================================================
   UI v2ï¼šç»Ÿä¸€çš„é…�è‰²ã€�å­—å�·ã€�å�¡ç‰‡å’ŒæŒ‰é’®ã€‚æ”¾åœ¨æ‰€æœ‰æ ·å¼�ä¹‹å�ŽåŠ è½½ã€‚
   ä¸»è‰²æ·±è“� #0f2a4aï¼Œå¼ºè°ƒè“� #2563ebï¼Œç»¿ #16a34a(å�¯å¼€å·¥/å®Œæˆ�)ï¼Œæ©™ #f59e0b(æ��é†’/ç­‰å¾…)ï¼Œçº¢ #dc2626(é£Žé™©)
   ============================================================ */
:root {
    --navy: #0f2a4a;
    --navy-2: #1e3a8a;
    --blue: #2563eb;
    --green: #16a34a;
    --amber: #f59e0b;
    --red: #dc2626;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #eef2f7;
    --card: #ffffff;
    --shadow: 0 1px 2px rgba(15, 42, 74, .06), 0 8px 24px rgba(15, 42, 74, .07);
    --shadow-lg: 0 2px 4px rgba(15, 42, 74, .08), 0 14px 34px rgba(15, 42, 74, .12);
}
body { background: var(--bg); color: var(--ink); font-family: "Noto Sans Thai", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif; }
#main-page, .main-container, .project-subview-container { background: var(--bg); }

/* ---------- é¡¶éƒ¨æ � ---------- */
.header { background: linear-gradient(90deg, #0b1f38, var(--navy)); color: #fff; padding: .7rem 1.6rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.header-left h2 { color: #fff; font-size: 1.25rem; letter-spacing: .5px; }
.header-left h2::before { content: "ðŸ�  "; }
.header .header-right, .header #user-name { color: #dbe7f5; font-size: 13px; }
.header .btn-link { color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; padding: 5px 12px; background: rgba(255, 255, 255, .08); }
.header .btn-link:hover { background: rgba(255, 255, 255, .2); }

/* ---------- é¡¹ç›®å¤´å›¾ ---------- */
#project-detail-container { max-width: 1240px; margin: 0 auto; width: 100%; }
.project-detail-header.hero { background: radial-gradient(1200px 300px at 90% -20%, #2f5fb3 0, transparent 60%), linear-gradient(135deg, var(--navy), #153e75); color: #fff; border-radius: 0 0 22px 22px; padding: 14px 24px 22px; display: block; box-shadow: var(--shadow-lg); border: 0; }
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hero .btn-back { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .28); border-radius: 10px; padding: 6px 14px; font-weight: 600; }
.hero .btn-back:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.hero .hero-bell { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); color: #fff; border-radius: 10px; font-size: 18px; padding: 5px 12px; position: relative; }
.hero .hero-bell:hover { background: rgba(255, 255, 255, .26); }
.hero-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.hero-title h2 { margin: 0; font-size: 30px; font-weight: 800; color: #fff; letter-spacing: .3px; }
.hero-title .project-location { margin: 6px 0 0; color: #bcd0ea; font-size: 15px; }
.hero-progress { min-width: 260px; flex: 0 1 340px; }
.hp-label { font-size: 12px; color: #bcd0ea; margin-bottom: 6px; }
.hp-row { display: flex; align-items: center; gap: 12px; }
.hp-row b { font-size: 26px; font-weight: 800; }
.hp-bar { flex: 1; height: 12px; background: rgba(255, 255, 255, .2); border-radius: 99px; overflow: hidden; }
.hp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #22c55e); border-radius: 99px; min-width: 4px; transition: width .4s; }
.sb-badge { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; margin-left: 4px; }

/* ---------- é¡µç­¾ï¼šå¤§å�·èƒ¶å›Š ---------- */
.project-nav.tabs-v2 { display: flex; gap: 10px; padding: 16px 20px 6px; background: transparent; border: 0; box-shadow: none; overflow-x: auto; }
.project-nav.tabs-v2 .nav-item { flex: 1 1 0; min-width: 150px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 42, 74, .05); color: #334155; cursor: pointer; transition: all .15s; white-space: nowrap; }
.project-nav.tabs-v2 .nav-item:hover { border-color: #93b4f0; background: #f5f9ff; color: var(--navy); }
.project-nav.tabs-v2 .nav-item.active { background: linear-gradient(135deg, var(--blue), #1d4ed8); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .35); transform: translateY(-1px); }
.project-nav.tabs-v2 .nav-icon { font-size: 22px; filter: none; }
.project-nav.tabs-v2 .nav-label { display: flex; flex-direction: column; text-align: left; line-height: 1.2; font-size: 15px; }
.project-nav.tabs-v2 .nav-label b { font-weight: 700; font-size: 15px; }
.project-nav.tabs-v2 .nav-label small { font-size: 11px; opacity: .75; margin-top: 2px; }
.nav-warn { color: #ef4444; font-size: 12px; }
.project-nav.tabs-v2 .nav-item.active .nav-warn { color: #fecaca; }
.project-subview-container { padding: 14px 20px 40px !important; }

/* ---------- é€šç”¨æŒ‰é’® ---------- */
.sb-btn { border-radius: 10px; font-weight: 600; padding: 8px 16px; font-size: 14px; border: 1.5px solid #cbd5e1; background: #fff; color: #1e293b; transition: all .12s; }
.sb-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.sb-btn.primary { background: linear-gradient(135deg, var(--blue), #1d4ed8); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.sb-btn.primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); }
.sb-btn.warn { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border-color: transparent; }
.sb-btn.small { padding: 5px 10px; font-size: 13px; }
.hero .sb-btn { box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue), #1d4ed8); border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 600; color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .28); }

/* ---------- é¡¹ç›®å‡†å¤‡ï¼šæ­¥éª¤å�¡ ---------- */
.pp-wrap { max-width: 980px; }
.td-head { align-items: flex-start; }
.td-title { font-size: 26px; font-weight: 800; color: var(--navy); margin: 0; }
.td-title .td-th { font-size: 14px; font-weight: 500; color: var(--muted); }
.td-sub { color: var(--muted); }
.pp-banner { border-radius: 14px; padding: 16px 20px; font-size: 15px; box-shadow: var(--shadow); }
.pp-banner b { font-size: 17px; }
.pp-banner.ok { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border: 1.5px solid #6ee7b7; }
.pp-banner.todo { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1.5px solid #fcd34d; color: #92400e; }
.pp-step { background: var(--card); border: 1px solid var(--line); border-left: 6px solid #cbd5e1; border-radius: 16px; padding: 18px 20px; gap: 16px; box-shadow: var(--shadow); align-items: center; }
.pp-step.done { border-left-color: var(--green); }
.pp-step.todo { border-left-color: var(--amber); background: linear-gradient(90deg, #fffdf5, #fff 40%); }
.pp-num { flex: 0 0 44px; height: 44px; font-size: 20px; font-weight: 800; background: #e2e8f0; color: #475569; }
.pp-step.done .pp-num { background: linear-gradient(135deg, #22c55e, #15803d); box-shadow: 0 4px 10px rgba(22, 163, 74, .35); }
.pp-step.todo .pp-num { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 4px 10px rgba(217, 119, 6, .35); }
.pp-title { font-size: 17px; font-weight: 700; }
.pp-why { font-size: 14px; margin-top: 6px; }
.pp-detail { font-size: 14px; background: #f1f5f9; border-radius: 8px; padding: 5px 10px; margin-top: 8px; font-weight: 600; color: var(--navy); }
.pp-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; }
.pp-act .sb-btn { min-width: 150px; padding: 10px 14px; }

/* ---------- ä»Šæ—¥çŽ°åœº ---------- */
.td-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0 6px; }
.td-stat { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--card); border: 0; border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); border-top: 5px solid #94a3b8; }
.td-stat > i { font-style: normal; font-size: 26px; width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; flex: 0 0 52px; }
.td-stat > div { display: flex; flex-direction: column; min-width: 0; }
.td-stat b { font-size: 34px; line-height: 1; font-weight: 800; color: var(--ink); }
.td-stat span { font-size: 13px; color: var(--muted); margin-top: 6px; }
.td-stat.s-doing { border-top-color: var(--blue); } .td-stat.s-doing > i { background: #dbeafe; }
.td-stat.s-ready { border-top-color: var(--green); } .td-stat.s-ready > i { background: #dcfce7; }
.td-stat.s-wait { border-top-color: var(--amber); } .td-stat.s-wait > i { background: #fef3c7; }
.td-stat.s-here { border-top-color: #64748b; } .td-stat.s-here > i { background: #e2e8f0; }
.td-stat.hot { background: linear-gradient(135deg, #f0fdf4, #fff); box-shadow: 0 0 0 2px #86efac, var(--shadow); }
.td-stat.hot b { color: var(--green); }
.td-tip { color: var(--muted); }
.td-banner { border-radius: 14px; padding: 16px 20px; background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1.5px solid #93c5fd; color: #1e3a8a; font-size: 14px; box-shadow: var(--shadow); }
.td-warn { border-radius: 12px; }
.td-sec { background: var(--card); border-radius: 16px; padding: 18px 20px; margin: 16px 0; box-shadow: var(--shadow); border: 0; }
.td-sec > h3 { font-size: 18px; font-weight: 800; color: var(--navy); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.td-num { width: 30px; height: 30px; font-size: 15px; font-weight: 800; background: linear-gradient(135deg, var(--blue), #1d4ed8); box-shadow: 0 3px 8px rgba(37, 99, 235, .35); }
.td-count { background: #e2e8f0; color: #334155; border-radius: 99px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.td-empty { background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 20px; color: var(--muted); }
.td-card { border-radius: 14px; border: 1.5px solid var(--line); border-left: 6px solid #94a3b8; background: #fff; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15, 42, 74, .06); }
.td-card.doing { border-left-color: var(--blue); background: linear-gradient(90deg, #f0f6ff, #fff 55%); }
.td-card.ready { border-left-color: var(--green); background: linear-gradient(90deg, #f2fdf5, #fff 55%); }
.td-card.paused { border-left-color: var(--amber); background: linear-gradient(90deg, #fffbeb, #fff 55%); }
.td-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.td-pct { font-weight: 800; color: var(--blue); }
.td-bar { height: 10px; border-radius: 99px; background: #e2e8f0; }
.td-bar i { background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 99px; }
.td-chip.big { padding: 8px 14px; font-size: 14px; border-radius: 99px; font-weight: 600; }
.td-tag { border-radius: 99px; font-weight: 600; }
.td-menu > summary { border-radius: 10px; font-weight: 600; }
.td-grp { border-radius: 12px; }

/* ---------- è¿›åº¦è®¡åˆ’ ---------- */
.processes-header { background: var(--card); border-radius: 16px; padding: 16px 20px; box-shadow: var(--shadow); border: 0; margin-bottom: 14px; }
.processes-header h3 { font-size: 20px; font-weight: 800; color: var(--navy); }
.processes-header .btn-primary { width: auto; }
.td-grp[class] { background: var(--card); box-shadow: var(--shadow); border: 0; margin: 14px 0; padding: 4px 16px 14px; }
.td-grp > summary { font-size: 18px; font-weight: 800; color: var(--navy); padding: 12px 0; cursor: pointer; }
.processes-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 4px; }
.process-card { border-radius: 14px; box-shadow: 0 1px 3px rgba(15, 42, 74, .08); border: 1.5px solid var(--line); }
.process-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.process-card-status-bar { height: 7px; }
.process-card-content { padding: 14px 16px 16px; }
.process-card-header { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.process-code-badge { background: var(--navy); border-radius: 8px; padding: 2px 10px; font-size: 12px; box-shadow: none; letter-spacing: .5px; }
.process-card-title { font-size: 16px; font-weight: 700; line-height: 1.35; }
.process-card-progress { margin: 10px 0; }
.progress-percentage { font-size: 20px; font-weight: 800; }
.progress-bar-container { height: 10px; border-radius: 99px; background: #e2e8f0; }
.progress-bar-fill { border-radius: 99px; }
.process-card-info { gap: 8px; margin: 8px 0; }
.process-card-actions { margin-top: 12px; padding-top: 12px; }
.process-card-actions .primary-action { padding: 10px 12px; font-size: 14px; border-radius: 10px; width: 100%; font-weight: 700; }
.process-card-actions .secondary-actions { margin-top: 8px; gap: 6px; }
.process-card-actions .secondary-action { padding: 5px 4px; font-size: 12px; border-radius: 8px; }

/* ---------- æ€»è§ˆæ��é†’ ---------- */
.project-overview { max-width: 1100px; margin: 0 auto; }
.overview-cards { grid-template-columns: repeat(4, 1fr); gap: 14px; }
.overview-card { border-radius: 16px; box-shadow: var(--shadow); border: 0; border-top: 5px solid var(--blue); padding: 16px 18px; }
.overview-card:nth-child(2) { border-top-color: var(--green); }
.overview-card:nth-child(3) { border-top-color: var(--amber); }
.overview-card:nth-child(4) { border-top-color: #64748b; }
.overview-card h3 { font-size: 13px; color: var(--muted); font-weight: 600; }
.card-value { font-size: 36px !important; font-weight: 800; color: var(--navy) !important; }
.detail-section { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 22px; margin: 16px 0; }
.detail-section h3 { font-size: 18px; font-weight: 800; color: var(--navy); border: 0; margin: 0 0 12px; padding: 0; }
.detail-section h4 { margin: 12px 0 6px; color: #b45309; }

/* ---------- å¼¹çª— ---------- */
.sb-dialog { border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 42, 74, .35); }
.sb-dialog header { background: linear-gradient(135deg, var(--navy), #1e4b8f); color: #fff; border-radius: 18px 18px 0 0; }
.sb-dialog header h3 { color: #fff; }
.sb-dialog header button { color: #fff; }

/* ---------- æ‰‹æœº ---------- */
@media (max-width: 860px) {
    .td-summary, .overview-cards { grid-template-columns: repeat(2, 1fr); }
    .hero-title h2 { font-size: 24px; }
    .project-nav.tabs-v2 .nav-item { min-width: 130px; padding: 10px 12px; }
    .project-subview-container { padding: 10px 12px 40px !important; }
    .project-detail-header.hero { border-radius: 0 0 18px 18px; padding: 12px 14px 18px; }
}

/* ä¸»åŒºåŸŸé“ºæ»¡å®½åº¦ï¼ˆå¤–å±‚æ˜¯ flexï¼Œ.view é»˜è®¤å�ªæŒ‰å†…å®¹å®½åº¦ï¼‰ */
.main-container > .view { flex: 1 1 auto; width: 100%; }
.project-nav.tabs-v2 .nav-label small { white-space: nowrap; }
.project-nav.tabs-v2 .nav-item { flex-shrink: 0; }

/* ---------- Ô¤¼Æ¹¤ÆÚÓëÈËÔ±ÅäÖÃ ---------- */
.est-panel { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 22px; margin: 0 0 16px; border-top: 5px solid var(--blue); }
.est-title { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 12px; }
.est-title small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.est-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.est-stat { background: #f1f5f9; border-radius: 12px; padding: 12px 14px; }
.est-stat b { display: block; font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.est-stat span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.est-good { color: var(--green); } .est-bad { color: var(--red); }
.est-note { margin-top: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.est-note a { color: var(--blue); font-weight: 700; margin-left: 6px; }
.est-det { margin-top: 12px; }
.est-det summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 6px 0; }
.est-line { margin: 8px 0 2px; padding: 6px 10px; background: #eff6ff; border-radius: 8px; font-size: 13px; color: #1e3a8a; line-height: 1.5; }
.est-line b { color: #1d4ed8; }
.est-warn { margin: 4px 0; padding: 5px 10px; background: #fef2f2; border-radius: 8px; font-size: 12.5px; color: #b91c1c; }
@media (max-width: 860px) { .est-stats { grid-template-columns: repeat(2, 1fr); } }

.est-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; margin: 10px 0 4px; }
.est-cell { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 8px 10px; min-width: 0; }
.est-cell > span { display: block; font-size: 11.5px; color: #475569; font-weight: 600; margin-bottom: 2px; }
.est-cell b { display: block; font-size: 14px; color: #1e3a8a; line-height: 1.3; word-break: break-word; }
.est-cell small { display: block; font-size: 11px; color: #64748b; margin-top: 2px; line-height: 1.3; }
.est-dim { color: #94a3b8 !important; font-weight: 600; }
.est-warn-t { color: #b45309 !important; }
.est-mini { font-size: 12.5px; color: #475569; margin-top: 3px; }
.process-card .est-grid { grid-template-columns: 1fr; }
@media (max-width: 640px) { .est-grid { grid-template-columns: 1fr; } }

/* ============================================================
   ½ñÈÕÏÖ³¡ ¹¤Í·°æ£º´ó°´Å¥¡¢ÇåÎúÈý²½¡¢ÊÖ»úÓÑºÃ
   ============================================================ */

/* Ò³ÃæÍ·²¿ÐÅÏ¢ÐÐ */
.fc-header { display:flex; justify-content:space-between; align-items:center; padding:10px 4px 6px; font-size:13px; color:var(--muted); border-bottom:2px solid var(--line); margin-bottom:4px; }
.fc-date { font-weight:700; color:var(--navy); }

/* ²½ÖèÇø¿é */
.fc-step { background:var(--card); border-radius:18px; box-shadow:var(--shadow); padding:16px 16px 14px; margin:12px 0; border:0; }
.fc-step.collapsed { padding:0; background:transparent; box-shadow:none; }
.fc-step-label { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.fc-step-label b { font-size:18px; font-weight:800; color:var(--navy); }
.fc-step-label.summ { list-style:none; cursor:pointer; padding:10px 16px; background:var(--card); border-radius:14px; box-shadow:var(--shadow); margin:0; }
.fc-step-label.summ::-webkit-details-marker { display:none; }
.fc-num { width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,var(--blue),#1d4ed8); color:#fff; font-weight:800; font-size:16px; display:flex; align-items:center; justify-content:center; flex:0 0 34px; box-shadow:0 3px 10px rgba(37,99,235,.35); }
.fc-num.fc-num-green { background:linear-gradient(135deg,var(--green),#15803d); box-shadow:0 3px 10px rgba(22,163,74,.35); }
.fc-num.fc-num-gray { background:#94a3b8; box-shadow:none; font-size:13px; }
.fc-badge { background:#dbeafe; color:#1e40af; border-radius:99px; padding:2px 10px; font-size:13px; font-weight:700; }
.fc-badge.green { background:#dcfce7; color:#166534; }
.fc-badge.gray { background:#e2e8f0; color:#475569; }
.fc-empty { text-align:center; padding:18px; color:var(--muted); background:#f8fafc; border-radius:12px; border:2px dashed var(--line); }

/* ³öÇÚÍø¸ñ */
.fc-att-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
.fc-att { display:flex; flex-direction:column; align-items:center; gap:5px; padding:14px 10px; border-radius:16px; border:2.5px solid; cursor:pointer; transition:all .15s; font-size:13px; background:#fff; }
.fc-att.skilled { border-color:#93c5fd; background:#eff6ff; }
.fc-att.helper { border-color:#bbf7d0; background:#f0fdf4; }
.fc-att.absent { border-color:#fca5a5; background:#fff1f2; opacity:.8; }
.fc-att:active { transform:scale(.95); }
.fc-att-icon { font-size:28px; line-height:1; }
.fc-att-name { font-weight:700; color:var(--navy); text-align:center; word-break:break-all; }
.fc-att-status { font-size:12px; font-weight:600; }
.fc-att.absent .fc-att-status { color:var(--red); }
.fc-att.skilled .fc-att-status { color:var(--blue); }
.fc-att.helper .fc-att-status { color:var(--green); }

/* ÈÎÎñ¿¨Æ¬ */
.fc-card { border-radius:16px; border:2px solid var(--line); padding:14px 14px 10px; margin:10px 0; border-left:6px solid #94a3b8; background:#fff; box-shadow:0 1px 4px rgba(15,42,74,.07); }
.fc-card.doing { border-left-color:var(--blue); background:linear-gradient(90deg,#f0f6ff,#fff 50%); }
.fc-card.doing.paused { border-left-color:var(--amber); background:linear-gradient(90deg,#fffbeb,#fff 50%); }
.fc-card.ready { border-left-color:var(--green); background:linear-gradient(90deg,#f0fdf4,#fff 50%); }
.fc-card-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; gap:8px; }
.fc-card-title { font-size:17px; font-weight:800; color:var(--navy); line-height:1.3; flex:1; }
.fc-card-pct { font-size:22px; font-weight:900; color:var(--blue); white-space:nowrap; }
.fc-progress { height:12px; border-radius:99px; background:#e2e8f0; margin:6px 0 10px; overflow:hidden; }
.fc-progress-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#3b82f6,#2563eb); transition:width .3s; }
.fc-card.paused .fc-progress-fill { background:linear-gradient(90deg,var(--amber),#d97706); }
.fc-card-meta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.fc-est-pill { background:#eff6ff; color:#1e3a8a; border:1px solid #bfdbfe; border-radius:99px; padding:3px 10px; font-size:12px; font-weight:600; }
.fc-status-tag { border-radius:99px; padding:3px 10px; font-size:12px; font-weight:700; background:#fef3c7; color:#92400e; }

/* Ö÷²Ù×÷°´Å¥£º³¬´ó¡¢Ò»ÑÛ¾Í¿´µ½ */
.fc-main-btn { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:16px 12px; border-radius:14px; font-size:17px; font-weight:800; border:0; cursor:pointer; transition:all .15s; margin-top:6px; letter-spacing:.3px; }
.fc-main-btn:active { transform:scale(.97); }
.fc-main-btn.prog { background:linear-gradient(135deg,var(--blue),#1d4ed8); color:#fff; box-shadow:0 6px 18px rgba(37,99,235,.35); }
.fc-main-btn.start { background:linear-gradient(135deg,var(--green),#15803d); color:#fff; box-shadow:0 6px 18px rgba(22,163,74,.35); }
.fc-main-btn.resume { background:linear-gradient(135deg,var(--amber),#d97706); color:#fff; box-shadow:0 6px 18px rgba(217,119,6,.35); }

/* ´ÎÒª²Ù×÷£ºÐ¡°´Å¥ÅÅÒ»ÐÐ */
.fc-secondary { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.fc-sec-btn { padding:8px 14px; border-radius:10px; font-size:13px; font-weight:600; border:1.5px solid var(--line); background:#f8fafc; color:#334155; cursor:pointer; }
.fc-sec-btn:hover { background:#e2e8f0; }
.fc-sec-btn.done { border-color:#a7f3d0; background:#f0fdf4; color:#065f46; }
.fc-sec-btn.warn { border-color:#fde68a; background:#fffbeb; color:#92400e; }

/* ÅÉÈË¡¢½¨Òé */
.fc-people { margin:8px 0; display:flex; flex-wrap:wrap; gap:6px; }
.fc-sug { margin:6px 0; font-size:13px; color:#475569; display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.fc-sug-chip { background:#dbeafe; color:#1e40af; border-radius:99px; padding:3px 10px; font-size:12px; font-weight:700; }

@media (max-width:560px) {
    .fc-att-grid { grid-template-columns:repeat(3,1fr); }
    .fc-main-btn { font-size:16px; padding:14px 10px; }
    .fc-card-title { font-size:15px; }
}

/* Í£¹¤Ô­ÒòÑ¡ÔñÐÐ */
.fc-reason-label { font-size:12px; color:#94a3b8; margin:12px 0 6px; font-weight:600; }
.fc-reason-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:4px; }
.fc-reason-btn { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:12px 6px; border-radius:14px; border:2px solid; cursor:pointer; font-size:12px; font-weight:700; text-align:center; transition:all .12s; background:#fff; line-height:1.3; }
.fc-reason-btn:active { transform:scale(.95); }
.fc-reason-btn.material { border-color:#fde68a; color:#92400e; }
.fc-reason-btn.material:hover { background:#fef3c7; }
.fc-reason-btn.weather { border-color:#bae6fd; color:#0369a1; }
.fc-reason-btn.weather:hover { background:#e0f2fe; }
.fc-reason-btn.done { border-color:#a7f3d0; color:#065f46; }
.fc-reason-btn.done:hover { background:#d1fae5; }
.fc-reason-icon { font-size:24px; }
.fc-reason-btn small { font-size:11px; font-weight:500; display:block; }

/* ¸ü¶à¹¦ÄÜ£ºÐ¡ÎÄ×ÖÁ´½ÓÅÅÒ»ÐÐ£¬·Å×îµ×²¿ */
.fc-more-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; padding-top:10px; border-top:1px dashed #e2e8f0; }
.fc-more-btn { padding:5px 12px; border-radius:8px; font-size:12px; font-weight:600; border:1px solid #e2e8f0; background:#f8fafc; color:#64748b; cursor:pointer; }
.fc-more-btn:hover { background:#e2e8f0; color:#334155; }

/* ½ñÈÕ¶¨¶î±êÇ©£¨ÔÚ½ø¶ÈÌõÏÂ·½£© */
.fc-quota { margin: 6px 0; padding: 5px 10px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-size: 13px; color: #92400e; }
.fc-quota b { color: #b45309; }

/* Â¼½ø¶Èµ¯´° */
.pg-title { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.pg-target { background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 10px; padding: 8px 12px; font-size: 14px; color: #92400e; margin-bottom: 12px; }
.pg-target b { font-size: 18px; color: #b45309; }
.pg-label { font-size: 14px; font-weight: 700; color: #475569; margin-bottom: 8px; }
.pg-qty-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pg-unit { font-size: 20px; font-weight: 700; color: #334155; white-space: nowrap; }
.pg-shortcuts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pg-scut { padding: 10px 6px; border-radius: 10px; border: 1.5px solid #e2e8f0; background: #f8fafc; color: #334155; font-size: 13px; font-weight: 700; cursor: pointer; text-align: center; line-height: 1.3; }
.pg-scut:hover { background: #e2e8f0; }
.pg-scut small { font-weight: 500; font-size: 12px; display: block; color: #64748b; margin-top: 2px; }
.pg-scut-std { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.pg-scut-std small { color: #b45309; }
.pg-scut-over { border-color: #86efac; background: #f0fdf4; color: #166534; }
.pg-scut-over small { color: #15803d; }
.pg-warn { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 7px 10px; font-size: 13px; color: #b91c1c; margin-bottom: 8px; }

/* ¶¨¶îÉèÖÃ±í */
.qr-table td, .qr-table th { vertical-align: middle; }
.qr-table .qin { border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 5px 6px; text-align: center; }
.qr-table .qin-out { border-color: #fde68a; background: #fffbeb; font-weight: 700; color: #92400e; }
.qr-table .qin:focus { outline: none; border-color: #3b82f6; }
tr.qr-modified { background: #fffde7; }
.qr-reset { font-size: 16px; border-radius: 8px; background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.qr-note { font-size: 12px; color: #92400e; background: #fffde7; padding: 5px 10px; border-radius: 8px; margin-bottom: 10px; }

/* ============================================================
   ¸ÊÌØÍ¼ Gantt Chart
   ============================================================ */
.gc-wrap { font-size: 14px; }
.gc-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 4px 14px; font-size: 13px; }
.gc-plan-tag { background: #fee2e2; color: #b91c1c; border-radius: 99px; padding: 2px 10px; font-weight: 700; }
.gc-est-tag { border-radius: 99px; padding: 2px 10px; font-weight: 700; }
.gc-est-tag.late { background: #fef2f2; color: #b91c1c; }
.gc-est-tag.ok { background: #dcfce7; color: #166534; }

/* Chart grid */
.gc-chart { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.gc-header { display: flex; background: #f8fafc; border-bottom: 2px solid var(--line); }
.gc-label-head { flex: 0 0 200px; padding: 10px 14px; font-weight: 700; color: var(--navy); font-size: 13px; border-right: 2px solid var(--line); }
.gc-track-head { flex: 1; position: relative; height: 36px; overflow: visible; }
.gc-month { position: absolute; top: 8px; font-size: 11px; color: #94a3b8; transform: translateX(-50%); white-space: nowrap; }
.gc-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 5; }
.gc-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; color: #dc2626; font-weight: 700; white-space: nowrap; background: #fff; padding: 0 2px; border-radius: 4px; }
.gc-deadline { position: absolute; top: 0; bottom: 0; width: 2px; background: #f97316; z-index: 4; }
.gc-deadline::after { content: '½ØÖ¹'; position: absolute; top: 2px; left: 3px; font-size: 9px; color: #f97316; white-space: nowrap; }

/* Rows */
.gc-row { display: flex; align-items: center; border-bottom: 1px solid #f1f5f9; min-height: 42px; cursor: pointer; transition: background .1s; }
.gc-row:hover { background: #f8fafc; }
.gc-row.task-row { min-height: 32px; cursor: default; background: #fafbfc; }
.gc-row.task-row:hover { background: #f1f5f9; }
.gc-label { flex: 0 0 200px; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-right: 2px solid var(--line); min-height: inherit; overflow: hidden; }
.gc-label.sub { padding-left: 28px; font-size: 12.5px; }
.gc-dot { font-size: 14px; flex: 0 0 18px; }
.gc-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-cnt { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.gc-arrow { font-size: 10px; color: #94a3b8; flex: 0 0 12px; }
.gc-track { flex: 1; position: relative; height: 100%; min-height: 32px; overflow: visible; }

/* Bars */
.gc-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 20px; border-radius: 6px; min-width: 4px; overflow: hidden; display: flex; align-items: center; }
.gc-bar.task { height: 14px; border-radius: 4px; }
.gc-bar-fill { height: 100%; border-radius: 6px; }
.gc-bar-label { position: absolute; right: 4px; font-size: 11px; font-weight: 700; color: #0f172a; white-space: nowrap; z-index: 2; }

@media (max-width: 700px) {
    .gc-label-head, .gc-label { flex: 0 0 120px; }
}

/* ½ø¶È¼Æ»®ÊÓÍ¼ÇÐ»»¹¤¾ßÀ¸ */
.proc-toolbar { display:flex; align-items:center; gap:8px; padding:10px 4px 14px; }
.proc-view-label { font-size:13px; color:var(--muted); font-weight:600; }
.proc-toggle { padding:8px 18px; border-radius:10px; border:2px solid var(--line); background:#fff; color:#334155; font-size:14px; font-weight:700; cursor:pointer; }
.proc-toggle.active { background:var(--blue); border-color:var(--blue); color:#fff; }

/* ¸ÊÌØÍ¼ÈÎÎñ²Ù×÷°´Å¥ */
.gc-task-acts { display:inline-flex; gap:5px; align-items:center; position:absolute; right:4px; top:50%; transform:translateY(-50%); z-index:3; }
.gc-act-btn { padding:4px 10px; border-radius:8px; font-size:12px; font-weight:700; border:1.5px solid; cursor:pointer; white-space:nowrap; }
.gc-act-btn.prog { border-color:#bfdbfe; background:#eff6ff; color:#1e40af; }
.gc-act-btn.prog:hover { background:#dbeafe; }
.gc-act-btn.done { border-color:#a7f3d0; background:#f0fdf4; color:#065f46; }
.gc-act-btn.done:hover { background:#dcfce7; }
.gc-act-btn.done-done { border-color:#e2e8f0; background:#f8fafc; color:#94a3b8; font-size:11px; }

.gc-weight { font-size:11px; color:#fff; background:#94a3b8; border-radius:99px; padding:1px 7px; font-weight:700; margin-left:4px; }
.gc-overall { background:linear-gradient(135deg,#1d4ed8,#1e40af); color:#fff; border-radius:99px; padding:3px 12px; font-weight:800; font-size:14px; }

/* Gantt chart v2: lighter, cleaner bars */
.gc-bar { border-radius: 8px !important; height: 22px !important; }
.gc-bar.task { height: 16px !important; border-radius: 6px !important; }
.gc-bar-fill { border-radius: 6px; transition: width .3s; }
.gc-bar-label { font-size: 12px !important; color: inherit !important; text-shadow: none; }
.gc-row { border-bottom: 1px solid #f1f5f9 !important; }
.gc-row:hover { background: #f8fafc !important; }
.gc-task-acts { gap: 4px !important; }
.gc-act-btn.prog { font-size: 11px !important; padding: 3px 8px !important; border-radius: 6px !important; }
.gc-act-btn.done { font-size: 11px !important; padding: 3px 8px !important; border-radius: 6px !important; }
.gc-act-btn.done-done { font-size: 11px !important; padding: 3px 8px !important; border-radius: 6px !important; opacity:.6; }
.gc-chart { border: 1px solid #e2e8f0 !important; border-radius: 12px !important; }
.gc-header { background: #f8fafc !important; border-bottom: 2px solid #e2e8f0 !important; }
.gc-weight { font-size: 10px !important; background: #f1f5f9 !important; color: #64748b !important; border-radius: 99px; padding: 1px 6px; margin-left: 3px; }
.gc-overall { font-size: 13px !important; padding: 4px 14px !important; }

/* Gantt Thai name */
.gc-name-th { display:block; font-size:10px; font-weight:500; color:#94a3b8; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.gc-weight small { font-size: 9px; }
.gc-weight { font-size: 10px !important; background: #e2e8f0 !important; color: #94a3b8 !important; border: 1px solid #cbd5e1; }

/* Progress label always outside bar */
.gc-bar-ext-label { position:absolute; top:50%; transform:translateY(-50%); font-size:12px; font-weight:700; white-space:nowrap; pointer-events:none; z-index:2; }
.gc-track { position:relative; overflow:visible; }

/* Wider label column so names don't truncate */
.gc-label-head, .gc-label { flex: 0 0 175px !important; }
@media (max-width: 900px) { .gc-label-head, .gc-label { flex: 0 0 130px !important; } }
.gc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.gc-name b { font-size: 13px; }

/* Fix label column - wider, names can wrap */
.gc-label-head, .gc-label { flex: 0 0 210px !important; min-width: 210px !important; }
.gc-label.sub { flex: 0 0 210px !important; min-width: 210px !important; padding-left: 24px !important; }
.gc-name { white-space: normal !important; overflow: visible !important; max-width: 155px !important; line-height: 1.3; }
.gc-name b { font-size: 13px; font-weight: 700; }
.gc-name-th { font-size: 9.5px !important; margin-top: 1px; display: block; }
.gc-row { min-height: 46px !important; }
.gc-cnt { font-size: 11px; white-space: nowrap; }
@media (max-width: 900px) {
  .gc-label-head, .gc-label, .gc-label.sub { flex: 0 0 140px !important; min-width: 140px !important; }
  .gc-name { max-width: 95px !important; }
}

/* Weight badge: compact, no wrap */
.gc-weight { white-space: nowrap !important; flex-shrink: 0; font-size: 9px !important; padding: 1px 5px !important; vertical-align: middle; }
.gc-weight small { font-size: 9px; }
.gc-cnt { flex-shrink: 0; white-space: nowrap; }
/* Tighten label gap so weight doesn't push to next line */
.gc-label { gap: 4px !important; flex-wrap: nowrap !important; }
.gc-name { flex: 1 1 0; min-width: 0; }
.gc-arrow { flex-shrink: 0; }

/* ========== Gantt complete redesign for readability ========== */
/* Remove old conflicting rules and set clear sizes */
.gc-label-head, .gc-label { flex: 0 0 200px !important; min-width: 200px !important; padding: 6px 10px !important; align-items: flex-start !important; gap: 6px !important; }
.gc-label.sub { flex: 0 0 200px !important; min-width: 200px !important; padding-left: 28px !important; }
.gc-dot { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.gc-name { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow: hidden; }
.gc-name b { font-size: 15px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.gc-name-th { font-size: 12px !important; color: #475569; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.gc-label-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: auto; }
.gc-cnt { font-size: 11px; color: #64748b; font-weight: 600; white-space: nowrap; background: transparent; border: 0; padding: 0; }
.gc-weight { font-size: 10px !important; padding: 1px 6px !important; border-radius: 99px; background: #e2e8f0 !important; color: #64748b !important; border: 0 !important; white-space: nowrap !important; }
.gc-arrow { font-size: 10px; color: #94a3b8; flex-shrink: 0; }
.gc-row { min-height: 48px !important; cursor: pointer; }
.gc-row.task-row { min-height: 38px !important; cursor: default; }
.gc-label-head-txt { font-size: 13px; font-weight: 700; color: #0f172a; }
.gc-label-head-th { font-size: 11px; color: #64748b; display: block; }

/* Weight in track area, not label area - free up space for names */
.gc-track-weight {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    font-size: 10px; font-weight: 600; color: #94a3b8;
    background: #f1f5f9; border-radius: 99px; padding: 1px 6px;
    pointer-events: none;
}
/* Name column now has full space */
.gc-name b { font-size: 14px !important; }
.gc-name-th { font-size: 11px !important; color: #64748b !important; }
/* Wider column since weight badge removed */
.gc-label-head, .gc-label { flex: 0 0 185px !important; min-width: 185px !important; }
.gc-label.sub { flex: 0 0 185px !important; min-width: 185px !important; }
.gc-name { max-width: 130px !important; }

/* Final fix: slightly wider name area for long Thai names */
.gc-name { max-width: 148px !important; }
.gc-label-head, .gc-label { flex: 0 0 195px !important; min-width: 195px !important; }
.gc-label.sub { flex: 0 0 195px !important; min-width: 195px !important; }

/* ====== Ã¿ÈÕÖ¸ÅÉÈÎÎñÃæ°å ====== */
.da-panel { position:fixed; right:0; top:0; bottom:0; width:420px; background:#fff; box-shadow:-4px 0 24px rgba(0,0,0,.15); z-index:900; display:flex; flex-direction:column; overflow:hidden; font-size:14px; }
.da-header { display:flex; justify-content:space-between; align-items:center; padding:16px 18px; background:var(--navy); color:#fff; flex-shrink:0; }
.da-header b { font-size:16px; }
.da-sub { padding:8px 18px; font-size:12px; color:#475569; background:#f8fafc; border-bottom:1px solid #e2e8f0; flex-shrink:0; }
#da-list { flex:1; overflow-y:auto; padding:8px 12px; }
.da-actions { padding:12px 16px; border-top:1px solid #e2e8f0; display:flex; gap:8px; flex-shrink:0; background:#f8fafc; }
.da-task-row { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; background:#fff; border:1.5px solid #e2e8f0; border-radius:12px; margin-bottom:8px; }
.da-task-row:hover { border-color:#bfdbfe; background:#f8faff; }
.da-task-main { flex:1; min-width:0; }
.da-task-name { font-weight:700; font-size:14px; color:#0f172a; }
.da-task-desc { font-size:12px; color:#64748b; margin-top:3px; }
.da-photos { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.da-task-btns { display:flex; flex-direction:column; gap:4px; flex-shrink:0; }
.da-photo-btn { cursor:pointer; }
.da-chip { font-size:11px; border-radius:99px; padding:1px 8px; font-weight:700; }
.da-chip.gray { background:#f1f5f9; color:#64748b; }
.da-chip.blue { background:#dbeafe; color:#1e40af; }
.da-chip.green { background:#dcfce7; color:#166534; }
.da-opt-row { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; cursor:pointer; font-size:13px; }
.da-opt-row:hover { background:#f1f5f9; }
.da-opt-row input { width:16px; height:16px; }
@media (max-width:560px) { .da-panel { width:100vw; } }

/* ====== ½ñÈÕÏÖ³¡£ºÀÏ°åÖ¸ÅÉÈÎÎñ ====== */
.da-boss-section { background: linear-gradient(135deg, #f0f6ff, #fff) !important; border: 2px solid #bfdbfe !important; }
.da-boss-section h3 { color: #1e40af !important; }
.da-badge-boss { width: 30px; height: 30px; background: linear-gradient(135deg,#2563eb,#1d4ed8); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; box-shadow: 0 3px 8px rgba(37,99,235,.35); }
.da-site-card { background: #fff; border: 1.5px solid #e2e8f0; border-left: 5px solid #2563eb; border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.da-site-card.in_progress { border-left-color: #f97316; background: #fffbf5; }
.da-site-card.completed { border-left-color: #16a34a; background: #f0fdf4; opacity: .8; }
.da-site-top { margin-bottom: 8px; }
.da-site-name { font-size: 16px; font-weight: 800; color: #0f172a; }
.da-site-desc { font-size: 13px; color: #64748b; margin-top: 3px; }
.da-site-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.da-site-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Thai-first bilingual: Thai large, Chinese small secondary */
.td-th-main { font-size: 18px; font-weight: 800; color: var(--navy); }
.td-zh-sub { font-size: 11px; font-weight: 500; color: #94a3b8; margin-left: 5px; }
.fc-th-label { font-size: 18px !important; font-weight: 800 !important; }
.fc-zh-sub { font-size: 11px !important; font-weight: 500 !important; color: #94a3b8 !important; margin-left: 5px; }

/* fc-stat Thai text */
.fc-stat { font-size: 13px; color: var(--muted); }

/* Foreman attendance: Thai "??????" / "?????" */
.fc-att-status { font-size: 13px !important; font-weight: 700 !important; }
.fc-att.skilled .fc-att-status { color: var(--blue); }
.fc-att.helper .fc-att-status { color: var(--green); }
.fc-att.absent .fc-att-status { color: var(--red); }

/* Main action buttons: Thai text bigger */
.fc-main-btn { font-size: 18px !important; font-weight: 800 !important; }
.fc-sec-btn { font-size: 13px !important; }
