:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #34d399;
  --accent: #06b6d4;
  --amber: #d97706;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: rgba(148, 163, 184, .18);
  --border-strong: rgba(148, 163, 184, .32);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, .03), 0 12px 32px rgba(15, 23, 42, .07);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, .04), 0 24px 54px rgba(15, 23, 42, .12);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[v-cloak] { display: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244, 247, 251, .88);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-divider { width: 1px; height: 26px; background: var(--border); }
.page-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { font-size: 11px; color: var(--faint); margin-top: 2px; }
.topbar-spacer { flex: 1; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-size: 12.5px; font-weight: 700; transition: .16s ease; white-space: nowrap;
}
.topbar-link .mdi { font-size: 16px; }
.topbar-link:hover { color: var(--primary-dark); background: #fff; box-shadow: var(--shadow-sm); }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .72); cursor: pointer;
  position: relative; transition: .18s ease;
}
.user-chip:hover { background: #fff; box-shadow: var(--shadow-sm); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 12px rgba(5, 150, 105, .2);
}
.user-name { font-size: 13px; font-weight: 700; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--faint); font-size: 15px; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 6px; overflow: hidden; z-index: 50;
}
.menu-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.menu-item:hover { background: #f8fafc; color: var(--text); }
.menu-item .mdi { font-size: 17px; }
.menu-item.danger { color: #dc2626; }
.menu-divider { height: 1px; background: var(--border); margin: 4px 6px; }

.content { max-width: 1320px; margin: 0 auto; padding: 22px 24px 64px; }

/* ── Stats ── */
.pm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card {
  display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex: 0 0 auto; }
.tone-green { background: #ecfdf5; color: #047857; }
.tone-blue { background: #eff6ff; color: #1d4ed8; }
.tone-amber { background: #fffbeb; color: #b45309; }
.tone-cyan { background: #ecfeff; color: #0e7490; }
.stat-label { font-size: 11.5px; color: var(--faint); font-weight: 700; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat-link { transition: .18s ease; }
.stat-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: rgba(5, 150, 105, .3); }

/* ── Reminder banner ── */
.reminder-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px;
  border-radius: 13px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  font-size: 12.5px; font-weight: 600; line-height: 1.6;
}
.reminder-banner b { font-weight: 800; }
.reminder-banner .mdi:first-child { font-size: 20px; flex: 0 0 auto; }
.reminder-banner .mdi:last-child { margin-left: auto; flex: 0 0 auto; }

/* ── Analytics ── */
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.analytics-grid.single { grid-template-columns: 1fr; }
.analytics-body { padding: 8px 18px 18px; }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.bar-label { width: 78px; font-size: 12px; color: var(--text-2); font-weight: 700; flex: 0 0 auto; }
.bar-track { flex: 1; height: 14px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); min-width: 2px; transition: width .3s ease; }
.bar-value { width: 34px; text-align: right; font-size: 12px; font-weight: 800; color: var(--text-2); }
.dist-section-title { font-size: 11px; font-weight: 800; color: var(--faint); letter-spacing: .04em; margin: 12px 0 4px; }
.dist-section-title:first-child { margin-top: 4px; }
.dist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(226, 232, 240, .7); font-size: 12.5px; }
.dist-row:last-child { border-bottom: 0; }
.dist-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.dist-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }
.dist-value { font-weight: 800; color: var(--text); }
.month-bars { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding: 10px 4px 0; }
.month-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.month-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.month-bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--primary-light), var(--primary)); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.month-label { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.month-value { font-size: 11px; font-weight: 800; color: var(--text-2); }
.due-list { padding: 4px 18px 16px; }
.due-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(226, 232, 240, .7); }
.due-item:last-child { border-bottom: 0; }
.due-main { flex: 1; min-width: 0; }
.due-title { font-size: 12.5px; font-weight: 800; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.due-sub { font-size: 11px; color: var(--faint); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.due-side { text-align: right; flex: 0 0 auto; }
.due-date { font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.due-days { margin-top: 4px; }
@media (max-width: 1080px) {
  .analytics-grid { grid-template-columns: 1fr; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 15px; border-radius: 11px; border: 1px solid transparent;
  font-size: 13px; font-weight: 700; transition: .18s ease; white-space: nowrap;
}
.btn .mdi { font-size: 17px; }
.btn-primary { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; box-shadow: 0 6px 16px rgba(5, 150, 105, .2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(5, 150, 105, .26); }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--text-2); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.btn-ghost:hover { border-color: rgba(5, 150, 105, .45); color: var(--primary-dark); background: #f8fdfb; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(5, 150, 105, .14); }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { min-height: 33px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid rgba(5, 150, 105, .5); outline-offset: 2px; }

/* ── Cards / sections ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.panel-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.panel-title .mdi { color: var(--faint); font-size: 17px; }
.panel-sub { font-size: 12px; color: var(--faint); }
.section-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.section-title .mdi { color: var(--primary); font-size: 19px; }

/* ── Toolbar / inputs ── */
.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; padding: 15px 16px; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-wrap .mdi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 17px; }
.input, .textarea {
  width: 100%; border: 1.5px solid rgba(148, 163, 184, .2); background: #fff; color: var(--text);
  border-radius: 11px; font-size: 13px; outline: none; transition: .18s ease;
}
.input { height: 40px; padding: 0 13px; }
.search-wrap .input { padding-left: 37px; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(5, 150, 105, .09); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.7; }

/* ── Custom select ── */
.select-wrap { position: relative; min-width: 136px; }
.select-btn {
  width: 100%; height: 40px; padding: 0 32px 0 13px; border-radius: 11px; border: 1.5px solid rgba(148, 163, 184, .2);
  background: #fff; color: var(--text-2); font-size: 12.5px; font-weight: 700; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.select-btn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-btn:hover { border-color: rgba(5, 150, 105, .35); }
.select-btn .chevron { color: var(--faint); font-size: 16px; transition: .18s ease; }
.select-btn.open .chevron { transform: rotate(180deg); }
.select-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 5px; max-height: 280px; overflow-y: auto;
}
.select-option { padding: 9px 11px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.select-option > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-option:hover { background: #f8fafc; color: var(--text); }
.select-option.active { background: #ecfdf5; color: #047857; font-weight: 800; }

/* ── Date picker ── */
.date-wrap { position: relative; }
.date-btn { width: 100%; height: 40px; padding: 0 13px; border-radius: 11px; border: 1.5px solid rgba(148, 163, 184, .2); background: #fff; color: var(--text); font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-btn.placeholder { color: var(--faint); }
.date-btn:hover { border-color: rgba(5, 150, 105, .35); }
.date-btn .mdi { color: var(--faint); font-size: 17px; }
.date-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 45; width: 274px; max-width: calc(100vw - 48px); background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); padding: 12px; }
.date-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.date-month { font-size: 13px; font-weight: 800; }
.date-nav { display: flex; gap: 4px; }
.date-nav button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); display: grid; place-items: center; font-size: 15px; }
.date-nav button:hover { color: var(--primary-dark); border-color: rgba(5, 150, 105, .3); }
.date-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.date-week span { text-align: center; font-size: 10px; color: var(--faint); font-weight: 800; padding: 4px 0; }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-cell { height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; }
.date-cell:hover { background: #f0fdf4; color: var(--primary-dark); }
.date-cell.out { color: #cbd5e1; }
.date-cell.today { box-shadow: inset 0 0 0 1px var(--primary-light); }
.date-cell.active { background: var(--primary); color: #fff; font-weight: 800; }
.date-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.date-foot button { border: 0; background: transparent; color: var(--primary-dark); font-size: 12px; font-weight: 700; padding: 4px 6px; border-radius: 7px; }
.date-foot button:hover { background: #ecfdf5; }

/* ── Employee picker ── */
.emp-picker { position: relative; }
.emp-picker-btn { width: 100%; min-height: 40px; padding: 6px 12px; border-radius: 11px; border: 1.5px solid rgba(148, 163, 184, .2); background: #fff; text-align: left; display: flex; align-items: center; gap: 9px; }
.emp-picker-btn:hover { border-color: rgba(5, 150, 105, .35); }
.emp-picker-btn .placeholder { color: var(--faint); font-size: 13px; }
.emp-picker-btn .chevron { margin-left: auto; }
.emp-chip { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.emp-chip .avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.emp-chip-name { font-size: 12.5px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 46; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); padding: 8px; }
.emp-search { position: relative; margin-bottom: 7px; }
.emp-search .mdi { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 16px; }
.emp-search input { height: 36px; padding-left: 33px; }
.emp-dept-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 7px; max-height: 66px; overflow-y: auto; }
.emp-dept-chip { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 4px 9px; }
.emp-dept-chip.active { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.emp-list { max-height: 240px; overflow-y: auto; }
.emp-option { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.emp-option:hover { background: #f8fdfb; }
.emp-option.active { background: #ecfdf5; }
.emp-option-main { flex: 1; min-width: 0; }
.emp-option-name { font-size: 12.5px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.emp-option-meta { font-size: 10.5px; color: var(--faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-option .mdi-check { color: var(--primary); font-size: 16px; }
.login-off { font-size: 9.5px; font-weight: 800; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px; padding: 1px 6px; }
.emp-empty { padding: 14px 10px; text-align: center; color: var(--faint); font-size: 12px; }

/* ── Chips / badges ── */
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 12px; font-weight: 700; transition: .15s ease; user-select: none;
}
.chip:hover { border-color: rgba(5, 150, 105, .35); color: var(--primary-dark); }
.chip.active { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.chip .mdi { font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.badge-green { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-gray { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.badge-rose { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.badge-cyan { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.badge-violet { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

/* ── Progress ── */
.progress { height: 7px; border-radius: 999px; background: #e8eef5; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s ease; }
.progress-lg { height: 9px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-value { font-size: 12px; font-weight: 800; color: var(--primary-dark); min-width: 38px; text-align: right; }

/* ── Project table ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .04em; color: var(--faint); font-weight: 800; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid rgba(226, 232, 240, .75); color: var(--text-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .14s ease; }
.table tbody tr:hover td { background: #fbfdff; }
.project-name { font-size: 13px; font-weight: 800; color: var(--text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.project-code { font-size: 10.5px; color: var(--faint); font-weight: 700; }
.cell-muted { font-size: 11.5px; color: var(--faint); }
.people-cell { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.people-line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.people-line .mdi { font-size: 13px; color: var(--faint); flex: 0 0 auto; }
.people-line span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-actions { display: flex; gap: 5px; justify-content: flex-end; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); display: inline-grid; place-items: center; font-size: 15px; transition: .15s ease; }
.icon-btn:hover { color: var(--primary-dark); border-color: rgba(5, 150, 105, .3); background: #f8fdfb; }
.icon-btn.danger:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

/* ── Mobile project cards ── */
.mobile-project-list { display: none; padding: 10px; gap: 9px; flex-direction: column; }
.mobile-project { border: 1px solid var(--border); border-radius: 13px; padding: 14px; background: #fff; cursor: pointer; }
.mobile-project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mobile-project .project-name { font-size: 13.5px; }
.mobile-project-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.mobile-project-meta span { display: inline-flex; align-items: center; gap: 4px; }
.mobile-project-meta .mdi { font-size: 14px; color: var(--faint); }
.mobile-project-progress { margin-top: 11px; }
.mobile-project-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }

/* ── Detail hero ── */
.detail-hero { padding: 22px; margin-bottom: 16px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hero-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.4; }
.hero-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hero-progress { margin-top: 18px; }
.hero-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12px; color: var(--muted); font-weight: 700; }
.meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; margin-top: 18px; }
.meta-cell { background: #fff; padding: 12px 14px; min-width: 0; }
.meta-label { font-size: 10.5px; color: var(--faint); font-weight: 700; }
.meta-value { font-size: 13px; color: var(--text); font-weight: 700; margin-top: 4px; line-height: 1.5; overflow-wrap: anywhere; }
.meta-value.sub { font-size: 12px; color: var(--text-2); font-weight: 600; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ── Stage timeline ── */
.stage-list { padding: 8px 18px 18px; }
.stage-item { position: relative; padding-left: 34px; padding-top: 12px; }
.stage-item::before { content: ""; position: absolute; left: 11px; top: 34px; bottom: -8px; width: 2px; background: #e2e8f0; }
.stage-item:last-child::before { display: none; }
.stage-node {
  position: absolute; left: 0; top: 13px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; background: #f1f5f9; color: #94a3b8; border: 2px solid #e2e8f0;
}
.stage-item.done .stage-node { background: #ecfdf5; color: #047857; border-color: #6ee7b7; }
.stage-item.active .stage-node { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px rgba(5, 150, 105, .12); }
.stage-item.skipped .stage-node { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }
.stage-body { border: 1px solid var(--border); border-radius: 13px; padding: 12px 14px; background: #fff; }
.stage-item.active .stage-body { border-color: #a7f3d0; background: #f8fdfb; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; flex-wrap: wrap; }
.stage-name { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.stage-index { font-size: 10px; color: var(--faint); font-weight: 800; background: #f1f5f9; border-radius: 999px; padding: 1px 7px; }
.stage-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--faint); margin-top: 7px; }
.stage-meta b { color: var(--text-2); font-weight: 700; }
.stage-note { margin-top: 8px; font-size: 12px; color: var(--text-2); line-height: 1.7; background: #f8fafc; border-radius: 9px; padding: 8px 10px; }
.stage-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.stage-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 8px; font-size: 11px; color: var(--text-2); cursor: pointer; }
.file-chip:hover { border-color: rgba(5, 150, 105, .35); color: var(--primary-dark); background: #f8fdfb; }
.file-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .mdi { color: var(--faint); font-size: 13px; }

/* ── Attachments ── */
.att-list { padding: 6px 18px 16px; }
.att-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid rgba(226, 232, 240, .7); }
.att-item:last-child { border-bottom: 0; }
.att-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: #f1f5f9; color: #64748b; flex: 0 0 auto; }
.att-icon.contract { background: #f5f3ff; color: #6d28d9; }
.att-icon.link { background: #ecfeff; color: #0e7490; }
.att-main { flex: 1; min-width: 0; }
.att-title { font-size: 12.5px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.att-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 5px; font-size: 10.5px; color: var(--faint); }
.att-note { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; }
.att-actions { display: flex; gap: 5px; flex: 0 0 auto; }

/* ── Activity ── */
.activity-list { padding: 6px 18px 16px; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(226, 232, 240, .7); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; margin-top: 6px; flex: 0 0 auto; }
.activity-dot.green { background: var(--primary); }
.activity-dot.amber { background: var(--amber); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 12px; color: var(--text-2); line-height: 1.65; overflow-wrap: anywhere; }
.activity-time { font-size: 10.5px; color: var(--faint); margin-top: 3px; }

/* ── Empty / loading / pager ── */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 0 8px; }
.pager-info { font-size: 12px; color: var(--faint); min-width: 90px; text-align: center; }
.empty { padding: 46px 20px; text-align: center; color: var(--faint); font-size: 13px; }
.empty .mdi { display: block; font-size: 42px; color: #cbd5e1; margin-bottom: 10px; }
.empty .btn { margin-top: 14px; }
.loading { padding: 56px 20px; text-align: center; color: var(--faint); font-size: 13px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #d1fae5; border-top-color: var(--primary); animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal / form ── */
.overlay { position: fixed; inset: 0; background: rgba(10, 15, 30, .48); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 100%; max-width: 760px; max-height: calc(100vh - 40px); background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.modal.narrow { max-width: 460px; }
.modal.wide { max-width: 860px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 16px; font-weight: 800; }
.modal-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; background: #fbfdff; }
.icon-btn.modal-close { border: 0; background: transparent; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field { margin-bottom: 15px; }
.field.full { grid-column: 1 / -1; }
.field-label { display: block; font-size: 12px; font-weight: 800; color: var(--text-2); margin-bottom: 7px; }
.field-label .req { color: #dc2626; }
.field-hint { font-size: 11px; color: var(--faint); margin-top: 5px; line-height: 1.6; }
.form-divider { border-top: 1px solid var(--border); margin: 4px 0 16px; padding-top: 14px; font-size: 12px; font-weight: 800; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.form-divider .mdi { color: var(--faint); font-size: 16px; }
.upload-drop { border: 1.5px dashed rgba(148, 163, 184, .45); border-radius: 13px; padding: 22px; text-align: center; background: #f8fafc; cursor: pointer; transition: .16s ease; }
.upload-drop:hover, .upload-drop.drag { border-color: var(--primary); background: #f0fdf4; }
.upload-drop .mdi { font-size: 30px; color: var(--primary); display: block; margin-bottom: 7px; }
.upload-drop-title { font-size: 13px; font-weight: 800; color: var(--text-2); }
.upload-drop-sub { font-size: 11px; color: var(--faint); margin-top: 4px; line-height: 1.6; }
.upload-picked { margin-top: 10px; display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px; background: #ecfdf5; border: 1px solid #a7f3d0; font-size: 12px; color: #047857; }
.upload-picked .mdi { font-size: 17px; }
.upload-picked span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden-input { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.form-error { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 12px; line-height: 1.6; }

/* ── Gate ── */
.gate-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse 70% 50% at 15% 0%, rgba(5, 150, 105, .08), transparent 55%), var(--bg); }
.gate-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 38px 32px; text-align: center; box-shadow: var(--shadow-md); }
.gate-card img { height: 52px; width: auto; margin: 0 auto 18px; display: block; }
.gate-card .gate-icon { font-size: 48px; color: var(--primary); margin-bottom: 8px; }
.gate-title { font-size: 21px; font-weight: 800; }
.gate-sub { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 10px 0 22px; }
.gate-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }

/* ── Toast / confirm ── */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 11px; font-size: 13px; z-index: 200; box-shadow: var(--shadow-md); max-width: calc(100vw - 32px); text-align: center; }
.toast.error { background: #991b1b; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .pm-stats { grid-template-columns: repeat(2, 1fr); }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { padding: 10px 14px; }
  .brand-logo { height: 30px; }
  .brand-divider, .page-sub { display: none; }
  .topbar-link { display: none; }
  .content { padding: 16px 14px 56px; }
  .pm-stats { gap: 8px; }
  .stat-card { padding: 12px 13px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
  .stat-value { font-size: 20px; }
  .search-wrap { max-width: none; flex: 0 0 100%; }
  .toolbar .select-wrap { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .toolbar .btn-primary { flex: 1 1 100%; }
  .project-table-wrap { display: none; }
  .mobile-project-list { display: flex; }
  .hero-top { flex-direction: column; }
  .hero-actions { justify-content: flex-start; width: 100%; }
  .hero-actions .btn { flex: 1; }
  .hero-name { font-size: 19px; }
  .detail-hero { padding: 17px; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { max-height: calc(100vh - 20px); border-radius: 16px; }
  .overlay { padding: 10px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .stage-list, .att-list, .activity-list { padding-left: 12px; padding-right: 12px; }
  .att-item { flex-wrap: wrap; }
  .att-actions { width: 100%; justify-content: flex-end; }
  .att-icon { width: 34px; height: 34px; font-size: 17px; }
  .emp-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-height: 70vh; }
  .emp-list { max-height: 46vh; }
}
@media (max-width: 420px) {
  .stat-card { flex-direction: column; align-items: flex-start; gap: 6px; }
  .stat-icon { display: none; }
  .user-name { display: none; }
  .pm-stats { grid-template-columns: 1fr 1fr; }
}

/* ── 经营中台 ── */
.topnav { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: #eaeff5; border: 1px solid rgba(148,163,184,.14); }
.nav-link { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border-radius: 9px; color: var(--muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; transition: .16s ease; }
.nav-link:hover { color: var(--text-2); background: rgba(255,255,255,.55); }
.nav-link.active { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.nav-link .mdi { font-size: 16px; }

.tab-bar { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eaeff5; border: 1px solid rgba(148,163,184,.14); overflow-x: auto; }
.tab-pill { border: 0; background: transparent; color: var(--muted); border-radius: 9px; min-height: 34px; padding: 0 14px; font-size: 12.5px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab-pill.active { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.tab-pill .mdi { font-size: 16px; }

.toggle { width: 42px; height: 24px; border-radius: 999px; border: 1px solid #cbd5e1; background: #e2e8f0; padding: 2px; transition: .18s ease; display: inline-flex; align-items: center; }
.toggle::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.2); transition: .18s ease; transform: translateX(0); }
.toggle.on { background: var(--primary); border-color: var(--primary); }
.toggle.on::after { transform: translateX(18px); }

.warn-banner, .info-banner { display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; border-radius: 11px; font-size: 12px; line-height: 1.7; margin-bottom: 14px; }
.warn-banner { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.info-banner { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.warn-banner .mdi, .info-banner .mdi { font-size: 17px; flex: 0 0 auto; margin-top: 1px; }

.mini-finance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; margin-top: 16px; }
.mini-cell { background: #fff; padding: 12px 14px; min-width: 0; }
.mini-label { font-size: 10.5px; color: var(--faint); font-weight: 700; }
.mini-value { font-size: 17px; font-weight: 800; color: var(--text); margin-top: 4px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mini-value.green { color: var(--primary-dark); }
.mini-value.amber { color: #b45309; }
.mini-value.rose { color: #be123c; }
.mini-value.blue { color: #1d4ed8; }

.list-panel { padding: 4px 18px 16px; }
.list-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid rgba(226,232,240,.7); }
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: 12.5px; font-weight: 800; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.list-sub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 10.5px; color: var(--faint); }
.list-note { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; }
.list-side { text-align: right; flex: 0 0 auto; }
.list-amount { font-size: 13px; font-weight: 800; color: var(--text); }
.list-date { font-size: 10.5px; color: var(--faint); margin-top: 3px; }
.row-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.money-strong { font-weight: 800; color: var(--text); }
.money-green { font-weight: 800; color: var(--primary-dark); }
.money-rose { font-weight: 800; color: #be123c; }
.money-amber { font-weight: 800; color: #b45309; }

.contract-progress { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.contract-progress .progress { flex: 1; }
.contract-progress span { font-size: 11px; font-weight: 800; color: var(--text-2); min-width: 34px; text-align: right; }

.mobile-contract-list { display: none; padding: 10px; gap: 9px; flex-direction: column; }
.mobile-contract { border: 1px solid var(--border); border-radius: 13px; padding: 14px; background: #fff; cursor: pointer; }
.mobile-contract-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mobile-contract-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.mobile-contract-meta span { display: inline-flex; align-items: center; gap: 4px; }
.mobile-contract-meta .mdi { font-size: 14px; color: var(--faint); }

.detail-tabs { margin: 16px 0; }
.tab-content { padding: 4px 0; }
.tab-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab-panel-title { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.tab-panel-title .mdi { color: var(--faint); font-size: 17px; }
.tab-panel-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.invoice-no { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11px; color: var(--text-2); }
.file-row .att-icon { width: 34px; height: 34px; font-size: 17px; }

.finance-summary-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.summary-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 11px; background: #fff; border: 1px solid var(--border); font-size: 12px; color: var(--muted); font-weight: 600; }
.summary-pill b { color: var(--text); font-weight: 800; }
.summary-pill.amber b { color: #b45309; }
.summary-pill.rose b { color: #be123c; }
.summary-pill.green b { color: var(--primary-dark); }

@media (max-width: 1000px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
  .nav-link { flex: 0 0 auto; }
  .mini-finance { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .project-table-wrap { display: none; }
  .mobile-contract-list { display: flex; }
  .tab-panel-head { padding-left: 12px; padding-right: 12px; }
  .tab-panel-actions { width: 100%; }
  .tab-panel-actions .btn { flex: 1; }
  .list-row { flex-wrap: wrap; }
  .list-side { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; }
  .row-actions { width: 100%; justify-content: flex-end; }
  .mini-finance { grid-template-columns: 1fr 1fr; }
  .detail-tabs .tab-bar { width: 100%; }
  .summary-pill { flex: 1 1 calc(50% - 5px); justify-content: center; }
}
@media (max-width: 420px) {
  .mini-finance { grid-template-columns: 1fr 1fr; }
}

/* ── 投标资料库 ── */
.stat-card.stat-link { cursor: pointer; }
.materials-tags-row {
  flex: 1 0 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-top: 11px; border-top: 1px dashed var(--border);
}
.materials-tags-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--faint); }
.materials-tags-label .mdi { font-size: 15px; }
.materials-tags-row .chip { min-height: 28px; padding: 0 10px; font-size: 11.5px; }
.chip-count { font-size: 9.5px; font-weight: 800; color: var(--faint); background: #f1f5f9; border-radius: 999px; padding: 0 5px; }
.chip.active .chip-count { background: #d1fae5; color: #047857; }
.chip.small { min-height: 26px; padding: 0 10px; font-size: 11px; }
.expiry-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.expiry-date { font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.detail-actions-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.detail-summary {
  margin-top: 14px; padding: 13px 15px; border-radius: 12px; background: #f8fafc;
  border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); line-height: 1.8;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .materials-tags-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .materials-tags-row .chip { flex: 0 0 auto; }
  .materials-tags-label { flex: 0 0 auto; }
  .detail-actions-row { width: 100%; }
  .detail-actions-row .btn { flex: 1 1 calc(50% - 4px); }
}

/* ── 客户管理 CRM ── */
.crm-badge-stack { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.crm-mobile-card .money-strong { flex: 0 0 auto; }
.crm-name-field { position: relative; }
.crm-suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% - 26px); z-index: 35;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 6px; max-height: 240px; overflow-y: auto;
}
.crm-suggestion-head { padding: 6px 9px; font-size: 10.5px; font-weight: 800; color: var(--faint); }
.crm-suggestion {
  width: 100%; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
}
.crm-suggestion:hover { background: #f8fdfb; }
.crm-suggestion-name { font-size: 12.5px; font-weight: 800; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-suggestion-meta { font-size: 10.5px; color: var(--faint); flex: 0 0 auto; }
.crm-detail-badges { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.crm-detail-tabs .tab-bar { flex-wrap: nowrap; overflow-x: auto; }
.crm-created-line { margin-top: 16px; font-size: 11px; color: var(--faint); line-height: 1.8; }
.meta-inline { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.contact-list { padding: 4px 0; }
.contact-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid rgba(226,232,240,.7); }
.contact-item:last-child { border-bottom: 0; }
.contact-avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #059669, #06b6d4); color: #fff; font-weight: 800; font-size: 14px; flex: 0 0 auto;
}
.contact-main { flex: 1; min-width: 0; }
.contact-name { font-size: 13px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.contact-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; color: var(--muted); }
.contact-note { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.contact-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.visit-list { padding: 4px 0; }
.visit-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(226,232,240,.7); }
.visit-item:last-child { border-bottom: 0; }
.visit-date { width: 96px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.visit-day { font-size: 12px; font-weight: 800; color: var(--text-2); }
.visit-body { flex: 1; min-width: 0; }
.visit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.visit-owner { font-size: 12.5px; font-weight: 800; color: var(--text); }
.visit-summary { margin-top: 5px; font-size: 12px; color: var(--text-2); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.visit-next { margin-top: 6px; display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 6px 9px; }
.visit-next .mdi { font-size: 14px; }
.visit-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.crm-related-section { padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.crm-related-section:last-child { border-bottom: 0; margin-bottom: 0; }
@media (max-width: 760px) {
  .crm-badge-stack { flex-direction: row; flex-wrap: wrap; }
  .crm-detail-tabs .tab-bar { width: 100%; }
  .contact-item, .visit-item { flex-wrap: wrap; }
  .contact-actions, .visit-actions { width: 100%; justify-content: flex-end; }
  .visit-date { width: 100%; flex-direction: row; align-items: center; }
  .crm-related-section .list-row { flex-wrap: wrap; }
}
