/* ============================================================
   PM App — Global Styles (Alpine.js + Vanilla CSS)
   Mimics Element Plus look without any build step.
   ============================================================ */

/* —— Reset & Base —— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #409eff;
  --color-primary-light: #a0cfff;
  --color-primary-lighter: #ecf5ff;
  --color-success: #67c23a;
  --color-warning: #e6a23c;
  --color-danger: #f56c6c;
  --color-info: #909399;
  --color-text-primary: #303133;
  --color-text-regular: #606266;
  --color-text-secondary: #909399;
  --color-text-placeholder: #c0c4cc;
  --color-border: #dcdfe6;
  --color-border-light: #e4e7ed;
  --color-bg: #f5f7fa;
  --color-bg-page: #f0f2f5;
  --color-white: #ffffff;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 2px 20px rgba(0,0,0,.15);
  --font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* —— Layout Shell —— */
.app-layout {
  display: flex; flex-direction: column; height: 100vh;
}
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 20px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.app-title { font-size: 18px; font-weight: 700; color: var(--color-text-primary); }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-info { font-size: 14px; color: var(--color-text-regular); }
.app-main {
  flex: 1; overflow-y: auto;
  background: var(--color-bg-page);
  display: flex;
  flex-direction: column;
}

/* —— Buttons —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; font-size: 14px; line-height: 1;
  border-radius: var(--radius); border: 1px solid var(--color-border);
  background: var(--color-white); color: var(--color-text-regular);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: .1s;
}
.btn:hover { color: var(--color-primary); border-color: var(--color-primary-light); background: var(--color-primary-lighter); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.btn:active { color: #3a8ee6; border-color: #3a8ee6; transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(64,158,255,.35); }
.btn-primary:active { background: #3a8ee6; border-color: #3a8ee6; transform: translateY(0); }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.btn-success { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.btn-success:hover { background: #85ce61; border-color: #85ce61; color: #fff; }
.btn-lg { padding: 10px 20px; font-size: 16px; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-text { border: none; background: transparent; color: var(--color-text-regular); padding: 8px 10px; }
.btn-text:hover { color: var(--color-primary); background: transparent; border: none; }

/* —— Inputs & Selects —— */
.input, .select {
  height: 32px; padding: 0 12px; font-size: 14px;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-white); color: var(--color-text-primary);
  outline: none; transition: border-color .2s;
  font-family: var(--font-family);
}
.input:focus, .select:focus { border-color: var(--color-primary); }
.input::placeholder { color: var(--color-text-placeholder); }
.select { cursor: pointer; }
.textarea {
  height: auto; padding: 8px 12px; resize: vertical; min-height: 70px;
}

/* —— Table Header Filter Select —— */
.header-filter-select {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-regular);
  cursor: pointer;
  outline: none;
  padding: 4px 16px 4px 6px;
  width: 100%;
  font-family: var(--font-family);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23909399'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 12px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.header-filter-select:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-lighter);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23409eff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}
.header-filter-select:focus {
  color: var(--color-primary);
  background-color: var(--color-primary-lighter);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23409eff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}
.header-filter-select option {
  color: var(--color-text-primary) !important;
  background-color: var(--color-white) !important;
  font-weight: normal;
}

/* —— Custom Header Dropdown —— */
.custom-header-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-regular);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  user-select: none;
  background: transparent;
  width: 100%;
}
.custom-header-dropdown-trigger:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-lighter);
}
.dropdown-arrow-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  margin-left: 4px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.dropdown-arrow-icon.open {
  transform: rotate(180deg);
}

.custom-header-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  min-width: 100%;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px 0;
}
.custom-header-dropdown-item {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-regular);
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.custom-header-dropdown-item:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}
.custom-header-dropdown-item.active {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  font-weight: 600;
}




/* —— Tags —— */
.tag {
  display: inline-flex; align-items: center; padding: 2px 8px;
  font-size: 12px; border-radius: 3px; border: 1px solid;
  background: #f4f4f5; border-color: #e9e9eb; color: var(--color-text-regular);
}
.tag-primary { background: var(--color-primary-lighter); border-color: #d9ecff; color: var(--color-primary); }
.tag-success { background: #f0f9eb; border-color: #e1f3d8; color: var(--color-success); }
.tag-danger  { background: #fef0f0; border-color: #fde2e2; color: var(--color-danger); }
.tag-warning { background: #fdf6ec; border-color: #faecd8; color: var(--color-warning); }
.tag-info    { background: #f4f4f5; border-color: #e9e9eb; color: var(--color-info); }

/* —— Progress Bar —— */
.progress-bar {
  height: 14px; border-radius: 100px; background: #ebeef5; overflow: hidden;
  position: relative;
}
.progress-bar-inner {
  height: 100%; border-radius: 100px; transition: width .3s;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 500;
}

/* —— Table —— */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse; background: var(--color-white);
  border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); overflow: hidden;
  table-layout: fixed;
}
.data-table thead { background: var(--color-bg-page); }
.data-table th {
  padding: 7px 10px; text-align: left; font-weight: 600; font-size: 12px;
  color: var(--color-text-regular); border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap; vertical-align: middle;
}
.data-table th.center, .data-table td.center { text-align: center; }
.data-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--color-border-light);
  font-size: 12px; color: var(--color-text-primary); vertical-align: middle;
  word-break: break-word; overflow-wrap: break-word;
}
.data-table tr:hover td { background: var(--color-primary-lighter); transition: background .15s ease; }
.data-table tr.striped:nth-child(even) td { background: var(--color-bg); opacity: 0.9; }
.data-table tr.striped:nth-child(even):hover td { background: var(--color-primary-lighter); }
.data-table td a { color: var(--color-primary); text-decoration: none; cursor: pointer; }
.data-table td a:hover { text-decoration: underline; }
.data-table .col-empty { color: var(--color-text-placeholder); }

.data-table tr.row-accepted td {
  background-color: #f0f9eb !important;
}
.data-table tr.row-accepted:hover td {
  background-color: #e1f3d8 !important;
}

/* —— Checkbox —— */
.checkbox-cell { width: 40px; text-align: center; }
.checkbox-cell input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--color-primary); }

/* —— Pagination —— */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 16px; font-size: 13px; }
.pagination .page-info { color: var(--color-text-secondary); margin-right: 10px; }
.pagination .page-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-white); color: var(--color-text-regular);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: .1s;
}
.pagination .page-btn:hover { color: var(--color-primary); border-color: var(--color-primary-light); }
.pagination .page-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination .page-btn:disabled { color: var(--color-text-placeholder); cursor: not-allowed; }
.pagination .page-size-select { height: 30px; padding: 0 8px; border: 1px solid var(--color-border); border-radius: var(--radius); margin-left: 12px; font-size: 13px; }

/* —— Cards —— */
.card {
  background: var(--color-white); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); padding: 14px; margin-bottom: 10px;
}
.card-header {
  font-weight: 600; font-size: 15px; padding-bottom: 12px;
  margin-bottom: 12px; border-bottom: 1px solid var(--color-border-light);
}

/* —— Dialog / Modal —— */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; justify-content: center;
  z-index: 1000; animation: fadeIn .2s;
  overflow-y: auto;
  padding: 40px 0;
}
.modal-box {
  background: var(--color-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); min-width: 380px; max-width: 560px; width: 90%;
  animation: slideDown .2s;
  margin: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--color-border-light);
  font-size: 16px; font-weight: 600;
}
.modal-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--color-text-secondary); padding: 4px;
}
.modal-close:hover { color: var(--color-text-primary); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--color-border-light);
}

/* —— Form —— */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--color-text-regular); }
.form-label.required::after { content: ' *'; color: var(--color-danger); }
.form-input { width: 100%; display: block; }
.form-error { color: var(--color-danger); font-size: 12px; margin-top: 4px; }
.form-hint { color: var(--color-text-secondary); font-size: 12px; margin-top: 4px; }

/* —— Toolbar —— */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

/* —— Tabs —— */
.tabs { border-bottom: 2px solid var(--color-border-light); margin-bottom: 0; display: flex; gap: 0; }
.tab-item {
  padding: 8px 14px; cursor: pointer; color: var(--color-text-regular);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-size: 13px; transition: .2s; user-select: none;
}
.tab-item:hover { color: var(--color-primary); }
.tab-item.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 500; position: relative; }
.tab-item.active::after { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); width: 20px; height: 3px; background: var(--color-primary); border-radius: 2px; }

/* —— Overall Progress Bar —— */
.overall-progress-section {
  background: var(--color-white); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); padding: 6px 12px; margin-bottom: 8px;
}

/* —— Phase Progress Bar (8 nodes) —— */
.phase-bar-wrap {
  background: var(--color-white); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); padding: 6px 16px 4px; margin-bottom: 8px;
}
.phase-bar { display: flex; align-items: center; justify-content: center; }
.phase-node {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
  cursor: pointer; transition: all .2s;
}
.phase-node.completed { background: var(--color-primary); color: #fff; box-shadow: 0 2px 6px rgba(64,158,255,.2); }
.phase-node.active {
  background: #fff; color: var(--color-primary);
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 0 2px rgba(64,158,255,.12), 0 1px 4px rgba(0,0,0,.06);
}
.phase-node.pending {
  background: var(--color-bg); color: var(--color-text-placeholder);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.phase-line { flex: 1; height: 2px; min-width: 12px; }
.phase-line.done { background: var(--color-primary); }
.phase-line.active { background: linear-gradient(to right, var(--color-primary), var(--color-border)); }
.phase-line.pending { background: var(--color-border-light); }
.phase-labels { display: flex; justify-content: center; margin-top: 6px; }
.phase-label {
  flex: 1; text-align: center; font-size: 10px; color: var(--color-text-secondary); max-width: 80px;
}
.phase-label.active { color: var(--color-primary); font-weight: 600; }
.phase-actions { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }

/* —— Health Cards —— */
.health-cards { display: flex; gap: 8px; margin-bottom: 8px; }
.health-card {
  flex: 1; padding: 4px 10px; border-radius: 8px;
  background: var(--color-white); border: 1px solid var(--color-border-light);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  cursor: default;
}
.health-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.05); border-color: var(--color-primary-light); }
.health-card.health-success { border-left: 3px solid var(--color-success); }
.health-card.health-danger  { border-left: 3px solid var(--color-danger); }
.health-card.health-warning { border-left: 3px solid var(--color-warning); }
.health-card.health-info    { border-left: 3px solid var(--color-primary); }
.health-card.health-success .health-value { color: var(--color-success); }
.health-card.health-danger  .health-value { color: var(--color-danger); }
.health-card.health-warning .health-value { color: var(--color-warning); }
.health-card.health-info    .health-value { color: var(--color-primary); }
.health-label { font-size: 10px; color: var(--color-info); margin-bottom: 1px; }
.health-value { font-size: 14px; font-weight: 600; }

/* —— Tool Navigation (bottom bar) —— */
.tool-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--color-white);
  border-top: 1px solid var(--color-border-light); padding: 4px 12px 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 4px; z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,.04);
}
.tool-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 40px; padding: 3px 2px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent; transition: background .2s, border-color .2s, transform .15s; user-select: none;
}
.tool-card:hover { background: #f0f5ff; border-color: var(--color-primary-light); transform: translateY(-1px); }
.tool-card .tool-icon { font-size: 15px; }
.tool-card .tool-name {
  font-size: 9px; color: var(--color-text-regular); text-align: center; white-space: nowrap;
}
.tool-card.more-tool { color: var(--color-text-secondary); }

/* —— Detail Page Tab Content—— */
.detail-content { padding: 12px 12px 120px 12px; }
.detail-content .top-bar {
  display: flex; align-items: center; margin-bottom: 6px;
}
.detail-content .top-left {
  display: flex; align-items: center; gap: 8px;
}
.project-code-title { margin: 0; font-size: 18px; font-weight: 700; }

.tab-content { padding: 4px 0; }
.tab-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.tab-title { font-size: 13px; font-weight: 600; }
.tab-header-actions { display: flex; gap: 8px; }

/* —— Basic Info Grid (2-col on detail page) —— */
.basic-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; margin-bottom: 8px;
  background: var(--color-white); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); overflow: hidden;
}
.basic-info-cell {
  padding: 3px 8px; border-right: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  display: flex; flex-direction: column; gap: 1px;
}
.basic-info-cell:nth-child(2n) { border-right: none; }
.basic-info-label { font-size: 10px; color: var(--color-text-secondary); margin-bottom: 0; }
.basic-info-value { font-size: 12px; color: var(--color-text-primary); font-weight: 500; }
.basic-info-full {
  grid-column: 1 / -1; padding: 3px 8px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex; flex-direction: column; gap: 1px;
}
.basic-info-progress {
  grid-column: 1 / -1; padding: 8px 12px;
}

/* —— Personnel Grid (2-col) —— */
.personnel-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; margin-bottom: 8px;
  background: var(--color-white); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); overflow: hidden;
}
.personnel-cell {
  padding: 3px 8px; border-right: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  display: flex; flex-direction: column; gap: 1px;
}
.personnel-cell:nth-child(2n) { border-right: none; }
.personnel-cell:nth-child(5),
.personnel-cell:nth-child(6) { border-bottom: none; }

/* —— Dates Grid (2-col, 3 rows) —— */
.dates-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; margin-bottom: 8px;
  background: var(--color-white); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); overflow: hidden;
}
.dates-cell {
  padding: 3px 8px; border-right: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  display: flex; flex-direction: column; gap: 1px;
}
.dates-cell:nth-of-type(2n) { border-right: none; }
.dates-cell:nth-of-type(5),
.dates-cell:nth-of-type(6) { border-bottom: none; }

/* —— Log Timeline —— */
.log-filters { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.log-filter-tag {
  display: inline-flex; padding: 3px 10px; font-size: 12px;
  border-radius: 3px; cursor: pointer; user-select: none;
  background: #f4f4f5; border: 1px solid #e9e9eb; color: var(--color-text-regular);
}
.log-filter-tag.active { background: var(--color-primary-lighter); border-color: var(--color-primary-light); color: var(--color-primary); font-weight: 500; }
.log-timeline { padding-left: 8px; }
.log-item { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--color-border-light); }
.log-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
}
.log-dot.dot-info_change  { background: var(--color-info); }
.log-dot.dot-work_record  { background: var(--color-primary); }
.log-dot.dot-project_plan { background: var(--color-success); }
.log-dot.dot-issue_log    { background: var(--color-danger); }
.log-content { flex: 1; }
.log-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.log-operator { color: var(--color-text-regular); font-weight: 500; font-size: 12px; }
.log-time { color: var(--color-text-placeholder); font-size: 11px; }
.log-text { color: var(--color-text-primary); font-size: 12px; line-height: 1.5; white-space: pre-wrap; }

/* —— Login Page —— */
.login-page {
  display: flex; align-items: center; justify-content: center; height: 100vh;
  background: linear-gradient(135deg, #f0f5ff 0%, #ecf5ff 50%, #f5f7fa 100%);
}
.login-card {
  width: 380px; padding: 36px 28px;
  background: var(--color-white); border-radius: 16px;
  box-shadow: 0 4px 24px rgba(64,158,255,.12), 0 8px 40px rgba(0,0,0,.06);
  transition: box-shadow .3s ease;
}
.login-card:hover { box-shadow: 0 6px 32px rgba(64,158,255,.16), 0 12px 48px rgba(0,0,0,.08); }
.login-card h2 { text-align: center; margin-bottom: 4px; font-size: 22px; }
.login-card .subtitle { text-align: center; color: var(--color-text-secondary); margin-bottom: 28px; font-size: 14px; }
.login-card .form-group { margin-bottom: 18px; }
.login-card .input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(64,158,255,.15); transition: border-color .25s ease, box-shadow .25s ease; }

/* —— Tool Page —— */
.tool-page { max-width: 900px; margin: 0 auto; padding: 20px; }
.tool-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.tool-title { font-size: 20px; font-weight: 600; }
.section-card { margin-bottom: 16px; }
.input-row { display: flex; align-items: center; gap: 12px; }
.input-label { white-space: nowrap; color: var(--color-text-regular); }
.or-divider { color: var(--color-text-placeholder); font-size: 13px; }
.action-bar { display: flex; gap: 12px; margin-bottom: 16px; }
.progress-section { padding: 8px 0; }
.progress-msg { margin-top: 10px; color: var(--color-text-regular); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.output-file {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  padding: 10px 14px; background: var(--color-bg); border-radius: var(--radius);
}
.output-name { font-size: 15px; color: var(--color-text-primary); font-family: var(--font-mono); }
.output-actions { display: flex; gap: 10px; margin-bottom: 8px; }

/* —— Error Alert —— */
.alert {
  padding: 12px 16px; border-radius: var(--radius); margin-top: 12px;
  display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.alert-error { background: #fef0f0; border: 1px solid #fde2e2; color: var(--color-danger); }

/* —— Loading Spinner —— */
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--color-border-light);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }

/* —— Dropdown —— */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; z-index: 500;
  min-width: 140px; padding: 6px 0; margin-top: 6px;
  background: var(--color-white); border: 1px solid var(--color-border-light);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.dropdown-item {
  padding: 8px 16px; font-size: 13px; color: var(--color-text-regular);
  cursor: pointer; white-space: nowrap;
}
.dropdown-item:hover { background: var(--color-bg); }
.dropdown-item:disabled, .dropdown-item.disabled { color: var(--color-text-placeholder); cursor: not-allowed; }
.dropdown-item.disabled:hover { background: transparent; }

/* —— Section / Detail Area —— */
.detail-content { padding: 12px 12px 120px 12px; }
.detail-content .top-bar {
  display: flex; align-items: center; margin-bottom: 6px;
}
.detail-content .top-left {
  display: flex; align-items: center; gap: 8px;
}
.project-code-title { margin: 0; font-size: 18px; font-weight: 700; }

/* —— Empty State —— */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 0; color: var(--color-text-placeholder);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; margin-bottom: 16px; }

/* —— Status / Quotation —— */
.quoted { color: var(--color-success); font-weight: 500; font-size: 13px; }
.unquoted { color: var(--color-text-placeholder); font-size: 13px; }

/* —— Flex utilities —— */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }

/* —— Spacing —— */
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.p-20 { padding: 20px; }
.p-12 { padding: 12px; }

/* —— Scrollbar —— */
::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
  display: block !important;
}
::-webkit-scrollbar-thumb {
  background-color: #909399 !important;
  border-radius: 5px !important;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #606266 !important;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-page, #f0f2f5) !important;
}

/* Force non-auto-hiding scrollbars in WebView2/Windows */
html, body, .app-main, .table-wrap, .rule-grid, .todo-list, .outline-tree, .viewer-column {
  -ms-overflow-style: scrollbar !important;
}

/* —— Hidden —— */
.hidden { display: none !important; }

/* ============================================================
   Inline Editing Rows (Project Detail Page)
   ============================================================ */
.inline-edit-section {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
}
.inline-edit-row {
  display: flex;
  align-items: center;
  padding: 0 12px;
  min-height: 36px;
  border-bottom: 1px solid var(--color-border-light);
  gap: 12px;
}
.inline-edit-row:last-child {
  border-bottom: none;
}
.inline-edit-row:hover {
  background: var(--color-bg-page);
}

.inline-edit-label {
  width: 90px;
  min-width: 90px;
  font-size: 12px;
  color: var(--color-text-regular);
  font-weight: 500;
  line-height: 28px;
}

.inline-readonly {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-primary);
  padding: 2px 0;
  line-height: 22px;
}

.inline-input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-family);
}
.inline-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}
.inline-input::placeholder {
  color: var(--color-text-placeholder);
}

.inline-select {
  flex: 1;
  height: 28px;
  padding: 0 6px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-family);
  cursor: pointer;
  appearance: auto;
}
.inline-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}
.inline-select option:checked {
  background: var(--color-primary);
  color: #fff;
}

.inline-textarea {
  flex: 1;
  height: auto;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-family);
  resize: vertical;
  min-height: 40px;
  line-height: 1.5;
}
.inline-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}
.inline-textarea::placeholder {
  color: var(--color-text-placeholder);
}

/* Inline edit row with textarea — align top */
.inline-edit-row:has(.inline-textarea) {
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: 6px;
}
.inline-edit-row:has(.inline-textarea) .inline-edit-label {
  padding-top: 4px;
}

/* —— Projects Page: Todo Panel —— */
.projects-page-wrapper { position: relative; min-height: 100%; }
.todo-toggle-bar {
  display: inline-block; margin-right: 12px;
}
.todo-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 899;
  transition: opacity .25s ease;
}
.todo-sidebar {
  position: fixed; top: 0; right: -380px; width: 380px; height: 100vh;
  background: var(--color-white); box-shadow: -4px 0 20px rgba(0,0,0,.12);
  z-index: 900; transition: right .25s ease;
  display: flex; flex-direction: column; overflow: hidden;
}
.todo-sidebar.open { right: 0; }
.todo-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--color-border-light);
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.todo-filters {
  display: flex; gap: 6px; padding: 10px 16px; flex-shrink: 0;
}
.todo-add-form {
  padding: 0 16px 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--color-border-light);
}
.todo-add-form .input { margin-bottom: 6px; }
.todo-add-row { display: flex; gap: 6px; align-items: center; }
.todo-date-presets {
  display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap;
  align-items: center;
}
.preset-tag {
  font-size: 11px; padding: 4px 10px; border-radius: 12px;
  background: var(--color-bg); color: var(--color-text-regular);
  cursor: pointer; user-select: none;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}
.preset-tag:hover {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}
.preset-tag.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(64,158,255,0.3);
}
input[type="date"].todo-date-picker {
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-regular);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  position: relative;
}
/* 💡 默认透明隐藏原生的 yyyy/mm/dd 预输入提示 */
input[type="date"].todo-date-picker::-webkit-datetime-edit {
  color: transparent;
  transition: color 0.15s ease;
}
/* 💡 获得焦点或有日期值后显示真实日期文本 */
input[type="date"].todo-date-picker:focus::-webkit-datetime-edit,
input[type="date"].todo-date-picker.has-value::-webkit-datetime-edit {
  color: var(--color-text-regular);
}
/* 💡 使用伪元素构建精美的高级 placeholder '截止日期' */
input[type="date"].todo-date-picker::before {
  content: "截止日期";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-placeholder);
  font-size: 13px;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
/* 💡 获得焦点或选定日期值后优雅淡出 placeholder */
input[type="date"].todo-date-picker:focus::before,
input[type="date"].todo-date-picker.has-value::before {
  opacity: 0;
}
input[type="date"].todo-date-picker::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
input[type="date"].todo-date-picker::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.todo-list { flex: 1; overflow-y: auto; padding: 0; }
.todo-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--color-border-light);
  transition: background .15s;
}
.todo-item:hover { background: var(--color-bg-page); }
.todo-item.completed .todo-title { text-decoration: line-through; color: var(--color-text-placeholder); }
.todo-check {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; flex-shrink: 0; margin-top: 1px;
  color: var(--color-text-secondary); transition: color .15s;
}
.todo-check:hover { color: var(--color-primary); }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 13px; color: var(--color-text-primary); line-height: 1.4; word-break: break-word; }
.todo-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.todo-date { font-size: 11px; color: var(--color-text-secondary); }
.todo-date.todo-overdue { color: var(--color-danger); font-weight: 500; }
.todo-date.todo-due-soon { color: var(--color-warning); }
.todo-date.completed-date { color: var(--color-success); }

/* —— Toast / Message —— */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.toast {
  padding: 10px 20px; border-radius: var(--radius); font-size: 14px;
  box-shadow: var(--shadow); animation: slideInRight .3s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast-success { background: #f0f9eb; border: 1px solid #e1f3d8; color: var(--color-success); }
.toast-error   { background: #fef0f0; border: 1px solid #fde2e2; color: var(--color-danger); }
.toast-warning { background: #fdf6ec; border: 1px solid #faecd8; color: var(--color-warning); }
.toast-info    { background: #f4f4f5; border: 1px solid #e9e9eb; color: var(--color-info); }

/* —— Confirm Dialog —— */
.confirm-body { padding: 20px; font-size: 14px; color: var(--color-text-regular); }
.confirm-body .confirm-icon { font-size: 24px; margin-right: 8px; }
.confirm-body.warning { color: var(--color-warning); }

/* —— Section card header —— */
.section-title { font-weight: 600; color: var(--color-text-primary); }

/* —— Menu dropdown positioning —— */
.dropdown-right .dropdown-menu { left: auto; right: 0; }

/* —— Phase bar click hint —— */
.phase-node:hover { transform: scale(1.1); }

/* —— Small back button —— */
.back-btn { font-size: 18px; cursor: pointer; background: none; border: none; padding: 4px 8px; color: var(--color-text-regular); }
.back-btn:hover { color: var(--color-primary); }

/* —— Filed preview text —— */
.folder-preview {
  font-family: var(--font-mono); font-size: 12px; color: var(--color-text-regular);
  word-break: break-all; background: var(--color-bg);
  padding: 4px 8px; border-radius: 4px; display: inline-block;
}

/* ============================================================
   💨 Global Transitions for Theme Swapping
   ============================================================ */
body, .app-layout, .app-header, .app-main, .btn, .input, .select, .textarea, .card, .modal-box, table.data-table, .data-table td, .data-table th, .tab-item, .health-card, .overall-progress-section, .phase-bar-wrap, .tool-nav, .todo-sidebar, .todo-item, .basic-info-grid, .basic-info-cell, .personnel-grid, .personnel-cell, .dates-grid, .dates-cell {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

/* ============================================================
   🌌 璀璨深空 (Cosmic Dark Theme)
   ============================================================ */
.theme-cosmic-dark {
  --color-white: #0f1123;            /* 纯白元素反转为深夜紫蓝 */
  --color-bg-page: #080914;          /* 页面大背景反转为星际漆黑 */
  --color-bg: #0d0e1e;
  --color-border-light: #20233f;
  --color-border: #2c315b;
  --color-text-primary: #ecf0f8;     /* 字体色反转为高对比透亮白 */
  --color-text-regular: #a2a8ce;
  --color-text-secondary: #737b9d;
  --color-text-placeholder: #535875;
  --color-primary: #12c2e9;          /* 主强调色改为电光青色 */
  --color-primary-light: #48dbfb;
  --color-primary-lighter: rgba(18, 194, 233, 0.12);
  --color-success: #05c46b;          /* 成功态改为极光绿 */
  --color-warning: #ffa801;
  --color-danger: #ff5e57;
  --color-info: #737b9d;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 6px 30px rgba(0, 0, 0, 0.45);
}

.theme-cosmic-dark .login-page {
  background: linear-gradient(135deg, #080914 0%, #0d0e1e 50%, #0f1123 100%);
}

.theme-cosmic-dark .login-card {
  box-shadow: 0 4px 24px rgba(18, 194, 233, 0.15), 0 8px 40px rgba(0, 0, 0, 0.5);
}

.theme-cosmic-dark .login-card:hover {
  box-shadow: 0 6px 32px rgba(18, 194, 233, 0.25), 0 12px 48px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   🌿 极简莫兰迪 (Morandi Light Theme)
   ============================================================ */
.theme-morandi-light {
  --color-primary: #79867c;          /* 主强调色改为鼠尾草绿 */
  --color-primary-light: #a3b1a6;
  --color-primary-lighter: #f0f3f1;
  --color-bg-page: #f6f5f2;          /* 页面底色改为燕麦灰 */
  --color-bg: #efede8;
  --color-white: #faf9f6;            /* 元素背景改为暖乳白 */
  --color-text-primary: #2d302e;     /* 文字改用高级炭黑色 */
  --color-text-regular: #555d57;
  --color-text-secondary: #8c938d;
  --color-text-placeholder: #b2b8b3;
  --color-border-light: #e3dec3;
  --color-border: #c8c0a3;
  --radius: 8px;                     /* 升级为更加柔和的圆角 */
  --radius-lg: 10px;
  --shadow: 0 4px 16px rgba(121, 134, 124, 0.06);
  --shadow-lg: 0 6px 24px rgba(121, 134, 124, 0.1);
}

.theme-morandi-light .login-page {
  background: linear-gradient(135deg, #efede8 0%, #f6f5f2 50%, #faf9f6 100%);
}

.theme-morandi-light .login-card {
  box-shadow: 0 4px 24px rgba(121, 134, 124, 0.1), 0 8px 40px rgba(0, 0, 0, 0.04);
}

.theme-morandi-light .login-card:hover {
  box-shadow: 0 6px 32px rgba(121, 134, 124, 0.15), 0 12px 48px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   🎨 Miniature Theme Preview Cards
   ============================================================ */
.theme-preset-card {
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 6px;
  background: var(--color-white);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.theme-preset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--color-primary-light);
}

.theme-preset-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 8px rgba(64, 158, 255, 0.35);
  background: var(--color-white);
}

.theme-preview-palette {
  transition: all 0.2s ease;
}

.theme-preset-card.active .theme-preview-palette {
  transform: scale(1.02);
}

.theme-preview-label {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: var(--color-text-primary);
  transition: color 0.2s ease;
}

.theme-preset-card.active .theme-preview-label {
  color: var(--color-primary);
  font-weight: 600;
}

/* —— Dual Sync Button Styles —— */
.btn-sync {
  background: linear-gradient(135deg, #409eff 0%, #12c2e9 100%) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 500 !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(18, 194, 233, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-sync:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(18, 194, 233, 0.4);
  filter: brightness(1.08);
}

.btn-sync:active {
  transform: translateY(0) scale(0.98);
}

.btn-sync:disabled {
  background: var(--color-info) !important;
  box-shadow: none;
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   🔄 Data Linkage & Sync UI Styles
   ============================================================ */

/* Sync Warning / Info Banners */
.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  border-left: 5px solid;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sync-banner-warning {
  background: hsl(35, 100%, 97%);
  border-color: hsl(35, 90%, 50%);
  color: hsl(35, 90%, 25%);
}

.sync-banner-info {
  background: hsl(210, 100%, 97%);
  border-color: hsl(210, 90%, 50%);
  color: hsl(210, 90%, 25%);
}

.sync-banner-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Diff modal & tables */
.diff-modal-container {
  max-height: 450px;
  overflow-y: auto;
  margin: 15px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.diff-table th {
  background: var(--color-bg-light);
  color: var(--color-text-secondary);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}

.diff-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.diff-added {
  background-color: hsl(120, 70%, 96%) !important;
  color: hsl(120, 60%, 20%);
}

.diff-removed {
  background-color: hsl(0, 80%, 97%) !important;
  color: hsl(0, 60%, 25%);
}

.diff-changed {
  background-color: hsl(200, 80%, 96%) !important;
  color: hsl(200, 60%, 20%);
}

.diff-cell-highlight {
  font-weight: bold;
  text-decoration: underline;
}

.diff-legend {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Header Navigation Links */
.nav-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover {
  color: var(--color-primary);
  background: rgba(64, 158, 255, 0.08);
}
.nav-link.active {
  color: var(--color-primary);
  background: rgba(64, 158, 255, 0.12);
  font-weight: 600;
}

/* Dashboard Page Layout */
.dashboard-page-wrapper {
  position: relative;
  min-height: calc(100vh - 100px);
  padding: 24px;
  background: var(--color-bg);
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 12px;
  background: var(--color-white);
  border: 2px solid transparent;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
}
.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

/* Card gradients for different statistics */
.summary-card.total {
  background: linear-gradient(135deg, #ffffff 0%, #f4f7ff 100%);
  border-left: 5px solid #4f46e5;
}
.summary-card.active {
  background: linear-gradient(135deg, #ffffff 0%, #fdf9f2 100%);
  border-left: 5px solid #e6a23c;
}
.summary-card.accepted {
  background: linear-gradient(135deg, #ffffff 0%, #f0faf5 100%);
  border-left: 5px solid #67c23a;
}

/* Premium Selected Active styles with glowing shadows and border colors */
.summary-card.total.selected-tab {
  border: 2px solid #4f46e5;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.18);
  transform: translateY(-4px) scale(1.02);
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
}
.summary-card.active.selected-tab {
  border: 2px solid #e6a23c;
  box-shadow: 0 12px 28px rgba(230, 162, 60, 0.18);
  transform: translateY(-4px) scale(1.02);
  background: linear-gradient(135deg, #ffffff 0%, #fdf6ec 100%);
}
.summary-card.accepted.selected-tab {
  border: 2px solid #67c23a;
  box-shadow: 0 12px 28px rgba(103, 194, 58, 0.18);
  transform: translateY(-4px) scale(1.02);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9eb 100%);
}

.card-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.1;
}

.dashboard-charts-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 8px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.chart-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  height: 380px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.chart-card.chart-large {
  grid-column: span 2;
  height: 420px;
}

@media (max-width: 1100px) {
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .chart-card.chart-large {
    grid-column: span 1;
  }
}

.chart-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  border-left: 3px solid var(--color-primary);
  padding-left: 8px;
  line-height: 1.2;
}

.chart-body {
  flex: 1;
  width: 100%;
  min-height: 200px;
}

/* Online Update Progress Styles */
.update-progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.update-progress-inner {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width 0.1s ease-out;
}

.changelog-box {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.theme-cosmic-dark .changelog-box {
  background: rgba(255, 255, 255, 0.05);
  color: #a5b4fc;
}

/* ============================================================================
   🖥️ PM App Web Integrated Tools Layout & Styles (Option B)
   ============================================================================ */

/* —— Fullscreen Mode Override —— */
.tool-page-fullscreen {
  max-width: 100% !important;
  width: 100% !important;
  height: calc(100vh - 56px) !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* —— SN Fill Workbench Center-occupying Layout (60% width) —— */
.sn-fill-workbench-container {
  width: 60% !important;
  min-width: 1000px !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 12px 0 !important;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px) !important;
  box-sizing: border-box;
}

/* ==========================================
   📊 1. Config Compare Shared Controls
   ========================================== */
.compare-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  background: rgba(30, 41, 59, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  z-index: 100;
}
.compare-toolbar .tool-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0;
}
.compare-toolbar .toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.compare-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-workspace .input {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  height: 30px;
  font-size: 13px;
}
.compare-workspace .input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.compare-workspace .btn {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}
.compare-workspace .btn:hover {
  background: #475569;
  border-color: #64748b;
  color: #ffffff;
}
.compare-workspace .btn-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}
.compare-workspace .btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}
.compare-workspace .btn-success {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}
.compare-workspace .btn-success:hover {
  background: #059669;
  border-color: #059669;
}
.compare-workspace .btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}
.compare-workspace .btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}
.compare-workspace .form-group {
  margin-bottom: 12px;
}
.compare-workspace .form-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.compare-workspace .form-input {
  width: 100% !important;
  height: 28px !important;
  font-size: 12px !important;
}
.compare-workspace .select {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

/* ==========================================
   📊 2. Config Compare Side-by-Side Diff
   ========================================== */
.compare-workspace {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0f172a;
  color: #f1f5f9;
}
.compare-toolbar {
  height: 56px;
}
.compare-file-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}
.compare-file-picker .file-label {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}
.compare-file-picker .path-input {
  width: 180px !important;
}

/* Compare View Base Layout */
.compare-main {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #0b1329;
}
.compare-split {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  min-width: 1150px;
}

/* Sidebar Stats & Tree */
.compare-sidebar {
  width: 260px;
  background: #1e293b;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.compare-sidebar .stats-panel {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.3);
}
.compare-sidebar .stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.compare-sidebar .stat-card {
  padding: 8px 4px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.compare-sidebar .stat-num {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}
.compare-sidebar .stat-label {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 2px;
  transform: scale(0.95);
}
.compare-sidebar .stat-card.matched {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.03);
}
.compare-sidebar .stat-card.matched .stat-num {
  color: #10b981;
}
.compare-sidebar .stat-card.incomplete {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.03);
}
.compare-sidebar .stat-card.incomplete .stat-num {
  color: #f59e0b;
}
.compare-sidebar .stat-card.missing {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.03);
}
.compare-sidebar .stat-card.missing .stat-num {
  color: #ef4444;
}

.compare-sidebar .outline-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.compare-sidebar .outline-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.compare-sidebar .outline-item {
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  color: #cbd5e1;
}
.compare-sidebar .outline-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}
.compare-sidebar .outline-item.matched {
  color: #10b981;
}
.compare-sidebar .outline-item.incomplete {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.08);
}
.compare-sidebar .outline-item.missing {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.08);
}
.compare-sidebar .outline-item.secondary {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.08);
}

/* Compare Viewer Columns */
.compare-viewer-container {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.viewer-columns {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.viewer-column {
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  background: #090d16;
}
#diff-column-a {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.viewer-column .column-header {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}
.viewer-column .column-body {
  padding: 8px 0;
}

/* Block & Line Highlighting */
.diff-block-box {
  margin: 8px 12px 14px 12px;
  padding: 6px;
  background: rgba(30, 41, 59, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  transition: all 0.2s ease;
}
.diff-block-box .block-title {
  padding: 3px 8px;
  font-weight: bold;
  font-size: 12px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.diff-block-box.matched {
  border-color: rgba(16, 185, 129, 0.12);
}
.diff-block-box.incomplete {
  border-color: rgba(245, 158, 11, 0.18);
}
.diff-block-box.missing {
  border-color: rgba(239, 68, 68, 0.18);
}

.diff-block-box .block-lines {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 12px;
}
.diff-block-box .line-row {
  display: flex;
  line-height: 1.6;
  padding: 1px 4px;
  border-radius: 2px;
  white-space: pre-wrap;
  word-break: break-all;
}
.diff-block-box .line-no {
  width: 30px;
  text-align: right;
  padding-right: 8px;
  color: #475569;
  user-select: none;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  margin-right: 8px;
}
.diff-block-box .line-content {
  flex: 1;
  color: #cbd5e1;
}

/* Line Status Colors */
.diff-block-box .line-row.ok {
  color: #cbd5e1;
}
.diff-block-box .line-row.missing {
  background: rgba(239, 68, 68, 0.15);
}
.diff-block-box .line-row.missing .line-content {
  color: #fca5a5;
}
.diff-block-box .line-row.supplement {
  background: rgba(59, 130, 246, 0.15);
}
.diff-block-box .line-row.supplement .line-content {
  color: #93c5fd;
}
.diff-block-box .line-row.empty-line {
  background: rgba(239, 68, 68, 0.04);
}
.diff-block-box .line-row.empty-line .line-content {
  color: #475569;
  font-style: italic;
}

/* Flash Animation for Block Navigation Target */
@keyframes flash-yellow-glow {
  0% {
    background-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  }
  100% {
    background-color: rgba(30, 41, 59, 0.25);
    box-shadow: none;
  }
}
.flash-highlight {
  animation: flash-yellow-glow 3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Compare Placeholder state */
.compare-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  color: #64748b;
}
.compare-placeholder .placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.65;
}
.compare-placeholder .placeholder-title {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 8px;
}
.compare-placeholder .placeholder-desc {
  font-size: 13px;
  max-width: 400px;
  line-height: 1.6;
}



/* Hide number input spinners globally for stepper inputs */
.no-spin::-webkit-outer-spin-button,
.no-spin::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spin {
  -moz-appearance: textfield;
}



/* Cabling Device Set Hover Tooltip & Badges */
.device-set-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 11px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  min-width: 180px;
  text-align: left;
}
.cabling-node-card:hover .device-set-tooltip {
  display: block;
}
.device-set-badge {
  margin-top: 5px;
  padding: 3px 6px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 4px;
  font-size: 10px;
  color: #60a5fa;
  font-weight: bold;
  width: fit-content;
  display: inline-block;
  line-height: 1.4;
}

/* Premium Warning Modal styling */
.modal-box.warning-modal {
  border: 1px solid rgba(217, 119, 6, 0.25);
  box-shadow: 0 20px 40px rgba(217, 119, 6, 0.08), 0 8px 16px rgba(0, 0, 0, 0.12);
}
.theme-cosmic-dark .modal-box.warning-modal {
  border-color: rgba(245, 158, 11, 0.35);
  background: #101124;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(245, 158, 11, 0.1);
}
.warning-modal .modal-header {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #d97706;
}
.theme-cosmic-dark .warning-modal .modal-header {
  background: #251d14;
  border-bottom: 1px solid #452c0e;
  color: #fbbf24;
}
.warning-modal .confirm-body {
  padding: 24px 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-text-primary);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.warning-modal .confirm-body::before {
  content: "⚠️";
  font-size: 22px;
  flex-shrink: 0;
  margin-top: -2px;
}
.warning-modal .modal-footer {
  background: #fafafa;
  border-top: 1px solid #f3f4f6;
}
.theme-cosmic-dark .warning-modal .modal-footer {
  background: #0b0c1b;
  border-top: 1px solid #20233f;
}

/* ============================================================================
   🛠️ Cabling Canvas Floating Warnings Widget Styles
   ============================================================================ */
.cabling-warnings-widget {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 420px;
  z-index: 96;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.cabling-warning-card {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-left: 6px solid #ef4444;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.25), 0 8px 10px -6px rgba(239, 68, 68, 0.25);
  padding: 14px 16px;
  color: #7f1d1d;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warning-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #fca5a5;
  padding-bottom: 6px;
}

.warning-icon {
  font-size: 14px;
  font-weight: 800;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-close-btn {
  background: none;
  border: none;
  color: #b91c1c;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
}

.warning-close-btn:hover {
  color: #ef4444;
  transform: scale(1.15);
}

.warning-card-body {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
  color: #7f1d1d;
}

/* —— Sentinel Warning Markdown Content —— */
.sentinel-markdown-content {
  line-height: 1.5;
}
.sentinel-markdown-content p {
  margin-bottom: 8px;
}
.sentinel-markdown-content p:last-child {
  margin-bottom: 0;
}
.sentinel-markdown-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.sentinel-markdown-content ul, .sentinel-markdown-content ol {
  padding-left: 20px;
  margin-bottom: 8px;
}
.sentinel-markdown-content li {
  margin-bottom: 4px;
}


