/* ==========================================
   项目全流程追溯系�?- H5 �?   ========================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f2f5; color: #1d1d1f; font-size: 14px; padding-bottom: 56px; }
#app { max-width: 100vw; min-height: 100vh; position: relative; }

/* Pages */
.page { display: none; }
.page.active { display: block; min-height: 100vh; }

/* ---- Login ---- */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%); padding: 40px; }
.login-card { background: #fff; border-radius: 32px; padding: 60px 40px 50px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.logo-icon { font-size: 60px; width: 100px; height: 100px; line-height: 100px; background: linear-gradient(135deg, #e8f0fe, #f0f4ff); border-radius: 50%; margin: 0 auto 20px; }
.logo-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.logo-desc { font-size: 14px; color: #999; margin-bottom: 40px; }
.login-btn { width: 100%; padding: 16px; background: #07c160; color: #fff; border: none; border-radius: 50px; font-size: 18px; font-weight: 500; cursor: pointer; box-shadow: 0 8px 24px rgba(7,193,96,0.3); }
.login-btn:active { transform: scale(0.96); }

/* ---- Header Bar ---- */
.page-header-bar { display: flex; align-items: center; padding: 16px 20px; background: #1a73e8; color: #fff; position: sticky; top: 0; z-index: 10; }
.back-btn { font-size: 16px; cursor: pointer; padding: 4px 8px; }
.page-header-title { flex: 1; font-size: 18px; font-weight: 600; text-align: center; }
.page-header-count { font-size: 15px; opacity: 0.9; }
.edit-btn-header { font-size: 13px; background: rgba(255,255,255,0.15); padding: 6px 16px; border-radius: 20px; cursor: pointer; }
.detail-action-btn { font-size: 13px; background: rgba(255,255,255,0.2); padding: 6px 16px; border-radius: 20px; cursor: pointer; margin-left: 6px; white-space: nowrap; }
.detail-action-btn.btn-terminate { background: rgba(234,67,53,0.3); }
.detail-action-btn.btn-restore { background: rgba(30,142,62,0.3); }
.detail-action-btn.btn-restore:hover { background: rgba(30,142,62,0.5); }
.detail-action-btn:hover { background: rgba(255,255,255,0.35); }
.detail-action-btn.btn-terminate:hover { background: rgba(234,67,53,0.5); }


/* ---- Home ---- */
.home { padding-bottom: 40px; }
.header-card { background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%); padding: 24px 20px 28px; color: #fff; border-radius: 0 0 32px 32px; position: relative; overflow: hidden; }
.header-card::before { content: ""; position: absolute; top: -100px; right: -60px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,0.05); }
.user-info { display: flex; align-items: center; margin-bottom: 20px; position: relative; z-index: 1; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; margin-right: 14px; border: 2px solid rgba(255,255,255,0.3); }
.user-name { font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.user-role { font-size: 13px; opacity: 0.85; }
.stats-row { display: flex; background: rgba(255,255,255,0.12); border-radius: 16px; padding: 12px 14px; position: relative; z-index: 1; }
.stat-item { flex: 1; text-align: center; cursor: pointer; }
.stat-item:first-child { border-right: 1px solid rgba(255,255,255,0.15); }
.stat-num { font-size: 26px; font-weight: 700; display: block; }
.stat-label { font-size: 13px; opacity: 0.85; }

/* Sections */
.section { margin: 16px 16px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 600; }
.section-title-inline { font-size: 18px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title-inline::before { content: ""; display: inline-block; width: 4px; height: 20px; background: #1a73e8; border-radius: 2px; }
.section-more { font-size: 13px; color: #1a73e8; cursor: pointer; }

/* Quick Grid */
.quick-grid { display: flex; gap: 12px; }
.quick-item { flex: 1; background: #fff; border-radius: 16px; padding: 16px 10px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.2s; }
.quick-item:active { transform: scale(0.95); background: #f8f9ff; }
.quick-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.quick-text { font-size: 12px; color: #666; font-weight: 500; }

/* ---- Project Card ---- */
.project-card { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); border-left: 4px solid #1a73e8; cursor: pointer; transition: transform 0.2s; }
.project-card:active { transform: scale(0.98); background: #fafbff; }
.project-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.project-card-name { font-size: 16px; font-weight: 600; }
.project-card-status { font-size: 12px; padding: 3px 14px; border-radius: 20px; font-weight: 500; }
.project-card-status.active, .project-card-status.in_progress { background: #e8f0fe; color: #1a73e8; }
.project-card-status.completed { background: #e6f4ea; color: #1e8e3e; }
.project-card-status.terminated { background: #fce8e6; color: #d93025; }
.project-card-code { font-size: 12px; color: #999; margin-bottom: 4px; }
.project-card-customer { font-size: 13px; color: #666; margin-bottom: 8px; }
.project-card-amount { font-size: 13px; color: #1a73e8; font-weight: 500; }
.project-card-stages { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.stage-dot-mini { width: 12px; height: 12px; border-radius: 50%; }
.stage-dot-mini.completed { background: #1e8e3e; }
.stage-dot-mini.in_progress { background: #1a73e8; }
.stage-dot-mini.pending { background: #e0e0e0; }

/* ---- Search & Filter ---- */
.projects-content, .issues-content { padding: 16px 20px; }
.search-bar { display: flex; flex-direction: row; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-input { flex: 1; background: #fff; border-radius: 40px; padding: 10px 16px; font-size: 14px; border: 2px solid transparent; outline: none; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: border-color 0.2s; }
.search-input:focus { border-color: #1a73e8; }
.search-btn { background: #1a73e8; color: #fff; border: none; border-radius: 40px; padding: 10px 20px; font-size: 14px; white-space: nowrap; cursor: pointer; box-shadow: 0 4px 12px rgba(26,115,232,0.3); }
.filter-tabs { display: flex; gap: 10px; margin-bottom: 16px; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
.filter-tab { padding: 8px 24px; border-radius: 40px; background: #fff; font-size: 13px; color: #666; cursor: pointer; border: 1px solid #eee; flex-shrink: 0; }
.filter-tab.active { background: #1a73e8; color: #fff; border-color: #1a73e8; box-shadow: 0 4px 12px rgba(26,115,232,0.3); }

/* ---- Detail ---- */
.detail-content { padding: 0 0 40px; }
.header-card-mini { background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%); padding: 28px 24px 32px; color: #fff; }
.detail-pname { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.detail-pcode { font-size: 13px; opacity: 0.85; margin-bottom: 16px; }
.detail-info-row { display: flex; justify-content: space-between; font-size: 14px; opacity: 0.9; background: rgba(255,255,255,0.1); border-radius: 12px; padding: 12px 16px; }
.detail-content .section { margin: 16px 16px; }

/* Timeline */
.timeline { padding-left: 4px; }
.tl-item { display: flex; margin-bottom: 20px; }
.tl-dot { width: 48px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
.tl-dot::after { content: ""; position: absolute; top: 40px; width: 2px; height: calc(100% + 20px - 40px); background: #e0e0e0; }
.tl-item:last-child .tl-dot::after { display: none; }
.tl-dot-inner { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); position: relative; z-index: 1; }
.tl-content { flex: 1; background: #fff; border-radius: 12px; padding: 16px 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); margin-left: 12px; cursor: pointer; }
.tl-content:active { background: #f8f9ff; }
.tl-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tl-name { font-size: 15px; font-weight: 600; }
.tl-name-action { font-size: 12px; color: #1a73e8; }
.tl-time { font-size: 12px; color: #999; display: flex; gap: 12px; flex-wrap: wrap; }
.tl-item.completed .tl-content { border-left: 4px solid #1e8e3e; }
.tl-item.in_progress .tl-content { border-left: 4px solid #1a73e8; }
.tl-item.pending .tl-content { border-left: 4px solid #e0e0e0; }

/* ---- Stage Panel ---- */
.stage-panel-content { background: #fff; border-radius: 24px 24px 0 0; padding: 28px 24px 40px; width: 100%; max-height: 85vh; overflow-y: auto; position: absolute; bottom: 0; left: 0; right: 0; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.panel-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; }
.panel-title { font-size: 18px; font-weight: 700; }
.panel-close { font-size: 20px; color: #999; cursor: pointer; padding: 4px 8px; }
.panel-info { background: #f8f9ff; border-radius: 12px; padding: 16px; margin-bottom: 16px; font-size: 13px; color: #666; display: flex; flex-direction: column; gap: 6px; }
.panel-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.panel-actions button { flex: 1; padding: 12px; border: none; border-radius: 40px; font-size: 14px; font-weight: 500; cursor: pointer; }
.btn-start { background: #1a73e8; color: #fff; }
.btn-complete { background: #1e8e3e; color: #fff; }
.btn-warn-sm { background: #f9a825; color: #fff; }
.btn-err-sm { background: #d93025; color: #fff; }
.panel-section { margin-bottom: 20px; }
.panel-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-section-header h4 { font-size: 15px; }
.add-link-btn { font-size: 13px; color: #1a73e8; background: #e8f0fe; padding: 4px 14px; border-radius: 20px; cursor: pointer; }

/* File items */
.file-item { display: flex; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #f0f0f0; gap: 12px; cursor: pointer; }
.file-item:active { background: #f8f9ff; margin: 0 -8px; padding: 12px 8px; border-radius: 8px; }
.file-icon { font-size: 20px; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; display: block; }
.file-url { font-size: 11px; color: #1a73e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.file-remark { font-size: 11px; color: #999; }
.file-time { font-size: 11px; color: #ccc; white-space: nowrap; }

/* BOM items */
.bom-item { background: #f8f9ff; border-radius: 12px; padding: 14px; margin-bottom: 12px; border: 1px solid #e8f0fe; position: relative; }
.bom-info { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.bom-partname { font-size: 14px; font-weight: 600; }
.bom-partno { font-size: 12px; color: #999; }
.bom-detail { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #666; }
.bom-del { position: absolute; top: 12px; right: 12px; font-size: 12px; color: #d93025; background: #fce8e6; padding: 2px 10px; border-radius: 8px; cursor: pointer; }

/* Issue items */
.issue-item { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; border-left: 4px solid #f9a825; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.issue-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.issue-title { font-size: 14px; font-weight: 500; }
.issue-status { font-size: 12px; padding: 2px 12px; border-radius: 12px; }
.issue-status.open { background: #fff8e1; color: #f9a825; }
.issue-status.resolved { background: #e6f4ea; color: #1e8e3e; }
.issue-desc { font-size: 12px; color: #666; display: block; margin-bottom: 4px; }
.issue-time { font-size: 11px; color: #999; display: block; }

/* ---- Profile ---- */
.profile-header { background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%); padding: 60px 24px 40px; display: flex; align-items: center; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: bold; color: #fff; margin-right: 20px; border: 2px solid rgba(255,255,255,0.3); }
.profile-name { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.profile-role { font-size: 13px; color: rgba(255,255,255,0.85); }
.menu-list { margin: 16px 16px; padding-bottom: 24px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.menu-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.menu-item:last-child { border-bottom: none; }
.menu-val { color: #999; }
.logout-btn { display: block; width: calc(100% - 40px); margin: 40px 20px; padding: 14px; background: #fff; color: #d93025; border: 1px solid #fce8e6; border-radius: 40px; font-size: 15px; cursor: pointer; }
.logout-btn:active { background: #fce8e6; }

/* ---- Modal ---- */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-content { background: #fff; border-radius: 24px; padding: 32px; width: 85%; max-width: 400px; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.form-item { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: #333; font-weight: 500; margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px; border: 1px solid #e0e0e0; border-radius: 10px; font-size: 14px; outline: none; background: #fafafa; }
.form-input:focus { border-color: #1a73e8; background: #fff; }
.form-row { display: flex; gap: 12px; }
.form-item.half { flex: 1; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.modal-actions button { flex: 1; padding: 12px; border: none; border-radius: 40px; font-size: 14px; font-weight: 500; cursor: pointer; }
.btn-cancel { background: #f5f5f5; color: #666; }
.btn-confirm { background: #1a73e8; color: #fff; box-shadow: 0 4px 12px rgba(26,115,232,0.3); }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 60px 20px; color: #999; font-size: 14px; }

/* ---- Misc ---- */
#toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.75); color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 999; display: none; }

/* Countdown badge */
.countdown-badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.countdown-badge.normal { background: #e6f4ea; color: #1e8e3e; }
.countdown-badge.warning { background: #fff8e1; color: #f9a825; }
.countdown-badge.urgent { background: #fce8e6; color: #d93025; }
.countdown-badge.overdue { background: #d93025; color: #fff; }
/* WeChat Drive button */
.wxdrive-btn { display: block; width: 100%; margin-top: 8px; padding: 10px; background: #07c160; color: #fff; border: none; border-radius: 10px; font-size: 14px; cursor: pointer; }
.wxdrive-btn:active { opacity: 0.8; }

/* Upload Area */
.upload-area { border: 2px dashed #ccc; border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; background: #fafafa; transition: all 0.2s; }
.upload-area:active { border-color: #1a73e8; background: #e8f0fe; }
.upload-icon { font-size: 32px; color: #999; display: block; margin-bottom: 6px; }
.upload-text { font-size: 13px; color: #999; }

/* Image Previews */
.image-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview-item { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid #e0e0e0; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; font-size: 12px; line-height: 20px; text-align: center; cursor: pointer; }




/* Bottom Tab */
.bottom-tab { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; display: flex; border-top: 1px solid #e0e0e0; z-index: 1000; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.tab-item { flex: 1; text-align: center; padding: 8px 4px 6px; cursor: pointer; }
.tab-item.active { background: #f8f9ff; }
.tab-icon { font-size: 22px; display: block; margin-bottom: 2px; }
.tab-label { font-size: 11px; color: #999; }
.tab-item.active .tab-label { color: #1a73e8; }
#page-login.active ~ .bottom-tab, .bottom-tab.hidden { display: none; }


/* Team Page */
.team-content { margin: 0 16px; padding-top: 16px; }
.team-card { display: flex; align-items: center; background: #fff; border-radius: 16px; padding: 16px 20px; margin-bottom: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); cursor: pointer; }
.team-card:active { background: #f8f9ff; }
.team-avatar { width: 48px; height: 48px; border-radius: 50%; background: #1a73e8; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; color: #fff; margin-right: 16px; flex-shrink: 0; }
.team-info { flex: 1; }
.team-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.team-position { font-size: 13px; color: #1a73e8; background: #e8f0fe; display: inline-block; padding: 2px 12px; border-radius: 10px; }
.team-role { font-size: 12px; color: #999; margin-top: 4px; }
.team-edit-btn { font-size: 13px; color: #1a73e8; padding: 6px 12px; border: 1px solid #d0d7ff; border-radius: 20px; background: none; cursor: pointer; }
.team-edit-btn:active { background: #e8f0fe; }
.team-phone { font-size: 12px; color: #999; margin-top: 2px; }
.team-badge-admin { font-size: 11px; background: #fff8e1; color: #f9a825; padding: 1px 10px; border-radius: 8px; margin-left: 8px; }


/* ---- Global Loading ---- */
#global-loading { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; justify-content: center; align-items: center; }
.loading-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.85); }
.loading-content { position: relative; text-align: center; background: #fff; padding: 40px 50px; border-radius: 20px; box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
.loading-spinner { width: 40px; height: 40px; margin: 0 auto 16px; border: 4px solid #e8f0fe; border-top: 4px solid #1a73e8; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: #666; }

/* ---- Smooth Page Transitions ---- */
.page.active { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Better Card Shadows ---- */
.project-card, .team-card, .issue-item { transition: transform 0.2s, box-shadow 0.2s; }
.project-card:hover, .team-card:hover, .issue-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* ---- Responsive Fixes ---- */
@media (max-width: 360px) {
  .quick-grid { flex-direction: column; }
  .stats-row { flex-direction: column; gap: 12px; }
  .stat-item:first-child { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 12px; }
}

/* ---- Enhanced Tab Bar ---- */
.bottom-tab { padding-top: 4px; }
.tab-item { position: relative; transition: all 0.2s; }
.tab-item::after { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 0; height: 3px; background: #1a73e8; border-radius: 0 0 3px 3px; transition: width 0.2s; }
.tab-item.active::after { width: 24px; }
.tab-item.active .tab-icon { transform: scale(1.1); }
.tab-icon { display: block; transition: transform 0.2s; }

/* ---- Enhanced Modal ---- */
.modal-content { animation: modalIn 0.25s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ---- Better Buttons ---- */
.btn-start:active, .btn-complete:active, .btn-confirm:active, .search-btn:active { transform: scale(0.96); opacity: 0.9; }
.btn-start, .btn-complete, .btn-confirm { transition: all 0.2s; }

/* ---- Empty State Improvement ---- */
.empty-state { padding: 60px 20px; }


/* ---- Detail Page Header Enhancements ---- */
.header-card-mini { position: relative; overflow: hidden; }
.header-card-mini::before { content: ""; position: absolute; top: -80px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.06); }
.header-card-mini::after { content: ""; position: absolute; bottom: -40px; left: -60px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,0.04); }

/* ---- Project Card Enhancements ---- */
.project-card { position: relative; overflow: hidden; }
.project-card::before { content: ""; position: absolute; top: 0; right: 0; width: 80px; height: 80px; background: linear-gradient(135deg, transparent 50%, rgba(26,115,232,0.03) 50%); border-radius: 0 16px 0 0; }

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ---- Add New Project FAB (hidden by default, shown on projects page) ---- */
.fab-add { display: none; position: fixed; bottom: 80px; right: 24px; width: 56px; height: 56px; background: #1a73e8; color: #fff; border: none; border-radius: 50%; font-size: 28px; box-shadow: 0 4px 20px rgba(26,115,232,0.4); cursor: pointer; z-index: 50; transition: all 0.2s; }
.fab-add:active { transform: scale(0.9); box-shadow: 0 2px 10px rgba(26,115,232,0.3); }
#page-projects.active ~ .fab-add { display: block; }

/* ---- Countdown badge animation ---- */
.countdown-badge.overdue { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ---- Position Management ---- */
.pos-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.pos-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pos-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: #e8f0fe; color: #1a73e8; border-radius: 20px; font-size: 13px; font-weight: 500; }
.pos-del { cursor: pointer; font-size: 12px; opacity: 0.6; padding: 0 2px; }
.pos-del:hover { opacity: 1; }

/* ---- Assignee ---- */
.panel-assignee { animation: fadeIn 0.2s ease; }
/* Disabled User */
.badge-disabled { font-size: 11px; background: #fce4ec; color: #d93025; padding: 1px 10px; border-radius: 8px; margin-left: 6px; }
.reactivate-btn { font-size: 12px; padding: 4px 10px; background: #e8f0fe; color: #1a73e8; border: none; border-radius: 6px; cursor: pointer; margin-left: 4px; }
.disable-btn { font-size: 12px; padding: 4px 10px; background: #fce4ec; color: #d93025; border: none; border-radius: 6px; cursor: pointer; margin-left: 4px; }
.btn-test-wh { font-size: 12px; padding: 6px 14px; background: #e8f0fe; color: #1a73e8; border: none; border-radius: 6px; cursor: pointer; }
.btn-test-wh:hover { background: #d2e3fc; }
.rework-complete-btn { font-size: 12px; padding: 4px 14px; background: #1e8e3e; color: #fff; border: none; border-radius: 14px; cursor: pointer; white-space:nowrap; }
.rework-complete-btn:hover { background: #166b2f; }
/* ---- Supplier Cards ---- */
.suppliers-content { padding: 12px; }
.supplier-card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.supplier-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.supplier-name { font-size: 15px; font-weight: 600; color: #333; }
.supplier-level { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.level-A { background: #e8f5e9; color: #2e7d32; }
.level-B { background: #e3f2fd; color: #1565c0; }
.level-C { background: #fff3e0; color: #e65100; }
.supplier-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.status-active { background: #e8f5e9; color: #2e7d32; }
.status-paused { background: #fff8e1; color: #f57f17; }
.status-terminated { background: #fbe9e7; color: #c62828; }
.supplier-info { font-size: 13px; color: #666; margin-top: 4px; display: flex; gap: 16px; }
.supplier-remark { font-size: 12px; color: #999; margin-top: 6px; padding: 8px; background: #f9f9f9; border-radius: 6px; }
.supplier-actions { display: flex; gap: 16px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.supplier-action-btn { font-size: 12px; color: #1a73e8; cursor: pointer; }

/* ---- Purchase Cards ---- */
.purchase-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.purchase-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.purchase-order-no { font-size: 14px; font-weight: 600; color: #333; font-family: monospace; }
.purchase-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e3f2fd; color: #1565c0; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-confirmed { background: #e3f2fd; color: #1565c0; }
.status-shipped { background: #e8f5e9; color: #2e7d32; }
.status-received { background: #e8f5e9; color: #2e7d32; }
.status-completed { background: #f3e5f5; color: #7b1fa2; }
.purchase-supplier { font-size: 13px; color: #555; margin-bottom: 4px; }
.purchase-items-list { font-size: 12px; color: #888; margin-bottom: 4px; line-height: 1.6; }
.purchase-total { font-size: 16px; font-weight: bold; color: #d32f2f; text-align: right; }
.purchase-remark { font-size: 12px; color: #999; margin-top: 4px; padding: 6px; background: #f9f9f9; border-radius: 4px; }
.purchase-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---- Purchase Item Row ---- */
.purchase-item-row { display: block; margin-bottom: 6px; }
.form-row { display: flex; gap: 12px; }

/* ---- Purchase Item Row (two-line layout) ---- */
.purchase-item-row {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid #eee;
}
.pi-name-line { margin-bottom: 6px; }
.pi-name-input { width: 100%; font-size: 14px; padding: 8px 10px; box-sizing: border-box; border: 1px solid #ddd; border-radius: 6px; }
.pi-detail-line { display: flex; align-items: center; gap: 6px; }
.pi-qty-input { width: 60px; min-width: 60px; text-align: center; padding: 6px 4px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.pi-unit-input { width: 50px; min-width: 50px; text-align: center; padding: 6px 4px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.pi-price-input { width: 70px; min-width: 70px; text-align: center; padding: 6px 4px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.pi-multiply, .pi-equals { color: #999; font-size: 14px; font-weight: bold; }
.pi-amount { font-size: 14px; font-weight: 600; color: #d32f2f; min-width: 50px; text-align: right; }

/* Issue item status colors */
.issue-item.status-open { border-left-color: #f9a825; }
.issue-item.status-reworking { border-left-color: #1a73e8; }
.issue-item.status-reworked { border-left-color: #1e8e3e; }
.issue-item.status-resolved { border-left-color: #999; }
.issue-status.reworking { background: #e3f2fd; color: #1a73e8; }
.issue-status.reworked { background: #e6f4ea; color: #1e8e3e; }


/* Issue item status colors */
.issue-item.status-open { border-left-color: #f9a825; }
.issue-item.status-reworking { border-left-color: #1a73e8; }
.issue-item.status-reworked { border-left-color: #1e8e3e; }
.issue-item.status-resolved { border-left-color: #999; }
.issue-status.reworking { background: #e3f2fd; color: #1a73e8; }
.issue-status.reworked { background: #e6f4ea; color: #1e8e3e; }


/* ---- Detail Page Beautification ---- */
.header-card-mini { box-shadow: 0 4px 20px rgba(13,71,161,0.2); }
.detail-status-badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; background: rgba(255,255,255,0.2); margin-top: 12px; }
.detail-status-badge.active { background: rgba(255,255,255,0.2); color: #fff; }
.detail-status-badge.completed { background: rgba(30,142,62,0.3); color: #fff; }
.detail-status-badge.terminated { background: rgba(234,67,53,0.3); color: #fff; }
.tl-content { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.tl-content:hover { transform: translateX(4px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.tl-item.completed .tl-dot-inner { background: #e6f4ea; box-shadow: 0 2px 8px rgba(30,142,62,0.2); }
.tl-item.in_progress .tl-dot-inner { background: #e8f0fe; box-shadow: 0 2px 8px rgba(26,115,232,0.2); }
.tl-item.pending .tl-dot-inner { background: #f5f5f5; }
.detail-info-row { backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.15); }
