:root {
  --ink: #172538;
  --muted: #7b8a9d;
  --line: #e8edf3;
  --surface: #ffffff;
  --canvas: #f5f8fb;
  --blue: #3478f6;
  --blue-soft: #edf4ff;
  --green: #27a37b;
  --orange: #e49a42;
  --red: #e26a63;
  --shadow: 0 15px 45px rgba(40, 70, 110, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.6 "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 250px; background: #fff; border-right: 1px solid var(--line); padding: 24px 16px 18px; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #77a6ff, #4b74ee); font-size: 18px; font-weight: 800; box-shadow: 0 7px 16px rgba(70, 120, 240, .25); }
.brand strong { display: block; font-size: 15px; letter-spacing: .2px; }
.brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.tenant-note { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 14px; background: #f6f9fd; margin: 0 0 18px; }
.tenant-note small, .tenant-note b { display: block; }
.tenant-note small { color: var(--muted); font-size: 11px; }
.tenant-note b { font-size: 12px; font-weight: 600; margin-top: 2px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(39, 163, 123, .12); }
.nav-list { display: grid; gap: 5px; }
.nav-item { background: transparent; color: #607187; border-radius: 11px; padding: 11px 13px; text-align: left; display: flex; align-items: center; gap: 11px; font-weight: 600; transition: .2s ease; }
.nav-item span { width: 20px; text-align: center; color: #91a0b0; font-size: 16px; }
.nav-item:hover { background: #f5f8fd; color: var(--blue); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); }
.nav-item.active span { color: var(--blue); }
.sidebar-bottom { margin-top: auto; }
.security-tip { display: flex; gap: 9px; color: #8796a7; padding: 12px 9px; border-top: 1px solid var(--line); font-size: 11px; }
.security-tip span { color: var(--green); font-size: 16px; }
.security-tip b, .security-tip small { display: block; }
.security-tip b { color: #637487; font-size: 11px; font-weight: 600; }
.user-card { width: 100%; padding: 10px; background: #f9fbfd; display: flex; align-items: center; gap: 9px; border-radius: 12px; text-align: left; color: var(--ink); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #f1ad67; font-weight: 700; }
.user-meta { flex: 1; min-width: 0; }
.user-meta b, .user-meta small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta b { font-size: 12px; }
.user-meta small { color: var(--muted); font-size: 10px; }
.chevron { color: #99a7b7; }
.main-area { width: calc(100% - 250px); margin-left: 250px; padding: 32px 42px 60px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 36px; }
.breadcrumb { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.breadcrumb span { margin: 0 7px; color: #b7c1cc; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: -.5px; }
h2 { font-size: 23px; line-height: 1.25; margin-top: 3px; }
h3 { font-size: 16px; line-height: 1.3; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.icon-button, .help-button { background: #fff; color: #708096; border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 13px; }
.icon-button { width: 38px; padding: 0; font-size: 21px; }
.help-button { font-size: 12px; }
.primary-button, .secondary-button, .danger-button { border-radius: 10px; padding: 9px 15px; font-weight: 700; transition: .2s ease; }
.primary-button { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(52, 120, 246, .2); }
.primary-button:hover { background: #2567df; transform: translateY(-1px); }
.secondary-button { color: #536479; border: 1px solid var(--line); background: #fff; }
.secondary-button:hover { border-color: #b8c5d6; color: var(--blue); }
.danger-button { color: var(--red); background: #fff3f2; }
.text-button { color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; }
.view { display: none; }
.active-view { display: block; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: .25; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: 1.4px; font-size: 10px; font-weight: 800; }
.welcome-row, .page-actions-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.welcome-row p, .page-actions-row p { color: var(--muted); margin-top: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.metric-card .metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-card .metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.metric-card strong { display: block; font-size: 29px; line-height: 1; margin: 17px 0 8px; letter-spacing: -.5px; }
.metric-card small { color: var(--muted); font-size: 11px; }
.content-grid { display: grid; gap: 20px; }
.two-col { grid-template-columns: 1fr 1fr; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.attention-panel, .activity-panel { min-height: 350px; padding: 21px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 17px; }
.panel-heading h3 { margin-top: 3px; }
.compact-list { display: grid; gap: 4px; }
.empty-state { color: var(--muted); padding: 34px 12px; text-align: center; font-size: 13px; }
.compact-item { padding: 13px 10px; border-radius: 11px; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; }
.compact-item:hover { background: #f9fbfe; border-color: var(--line); }
.item-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #3767c7; background: #eaf1ff; font-weight: 800; flex: 0 0 auto; }
.compact-main { flex: 1; min-width: 0; }
.compact-main b, .compact-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-main b { font-size: 13px; }
.compact-main small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; border-radius: 99px; padding: 3px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pill.重点关注 { color: #c65c46; background: #fff0eb; }
.pill.持续关注 { color: #a56e22; background: #fff7df; }
.pill.一般关注 { color: #31816c; background: #eaf9f3; }
.page-actions-row { align-items: flex-end; }
.toolbar { display: flex; gap: 10px; padding: 13px; margin-bottom: 16px; align-items: center; }
.search-box { height: 38px; flex: 1; max-width: 480px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: #9aa9b8; }
.search-box input { border: 0; outline: 0; width: 100%; color: var(--ink); background: transparent; }
select, input, textarea { border: 1px solid #dfe6ee; outline: 0; border-radius: 9px; color: var(--ink); background: #fff; }
select, input { height: 38px; padding: 0 11px; }
textarea { padding: 10px 11px; resize: vertical; min-height: 84px; }
select:focus, input:focus, textarea:focus { border-color: #80aafc; box-shadow: 0 0 0 3px rgba(52, 120, 246, .1); }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 780px; }
th, td { text-align: left; padding: 15px 17px; border-bottom: 1px solid #edf1f5; white-space: nowrap; }
th { color: #7d8c9e; font-size: 11px; font-weight: 700; background: #fbfcfe; }
td { color: #46576b; font-size: 12px; }
td strong { color: var(--ink); font-size: 13px; }
.table-subline { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.summary-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
tr:last-child td { border-bottom: 0; }
.action-link { color: var(--blue); background: transparent; padding: 0; margin-right: 12px; font-size: 12px; font-weight: 700; }
.action-link.danger { color: var(--red); }
.table-footer { display: flex; justify-content: space-between; gap: 10px; padding: 13px 17px; color: var(--muted); border-top: 1px solid #edf1f5; font-size: 11px; }
.due-summary { display: flex; gap: 13px; align-items: center; padding: 17px 20px; margin-bottom: 18px; background: linear-gradient(135deg, #f5f9ff, #fff); }
.due-summary-icon { width: 38px; height: 38px; border-radius: 12px; background: #eaf1ff; color: var(--blue); display: grid; place-items: center; font-size: 21px; }
.due-summary b, .due-summary span { display: block; }
.due-summary span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.due-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.due-card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.due-card-top { display: flex; align-items: flex-start; gap: 11px; }
.due-card-main { flex: 1; }
.due-card-main b { display: block; font-size: 14px; }
.due-card-main small { color: var(--muted); display: block; margin-top: 3px; }
.due-card-meta { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #edf1f5; margin-top: 16px; padding-top: 13px; color: var(--muted); font-size: 11px; }
.permission-callout { display: flex; gap: 13px; padding: 17px 20px; margin-bottom: 18px; background: #f7fbff; }
.callout-icon { color: var(--blue); font-size: 22px; }
.permission-callout p { color: #65778c; margin-top: 3px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.setting-card { padding: 22px; min-height: 180px; }
.setting-icon { display: block; color: var(--blue); font-size: 24px; margin-bottom: 12px; }
.setting-card p { color: var(--muted); margin-top: 9px; }
.data-panel { padding: 18px 21px; display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.data-panel p { color: var(--muted); margin-top: 3px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(19, 32, 52, .42); z-index: 10; display: flex; justify-content: flex-end; }
.modal { background: #fff; width: min(560px, 100%); height: 100%; padding: 28px 30px; overflow-y: auto; box-shadow: -18px 0 60px rgba(16, 30, 55, .16); }
.wide-modal { width: min(760px, 100%); }
.small-modal { width: min(430px, 100%); height: auto; min-height: 350px; align-self: center; margin-right: 30px; border-radius: 16px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 22px; }
.modal-head h3 { font-size: 20px; margin-top: 2px; }
.close-button { width: 32px; height: 32px; border-radius: 9px; background: #f6f8fb; color: #718196; font-size: 23px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.form-grid label { display: grid; gap: 7px; color: #5c6e83; font-size: 12px; font-weight: 700; }
.form-grid label > span { color: var(--red); margin-left: 2px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; font-weight: 400; }
.span-2 { grid-column: span 2; }
.large-textarea { min-height: 125px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.profile-summary { display: flex; align-items: center; gap: 13px; padding: 15px; background: #f7faff; border: 1px solid #e5eefb; border-radius: 14px; }
.profile-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #3767c7; background: #e5efff; font-size: 20px; font-weight: 800; }
.profile-summary > div:nth-child(2) { flex: 1; }
.profile-summary p { color: var(--muted); margin-top: 2px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 24px; }
.detail-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.detail-grid small, .detail-grid b { display: block; }
.detail-grid small, .record-block small { color: var(--muted); font-size: 11px; }
.detail-grid b { margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.timeline { border-left: 2px solid #dce8fb; margin-left: 9px; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); left: -26px; top: 5px; box-shadow: 0 0 0 4px #eaf1ff; }
.timeline-date { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.timeline-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.timeline-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.timeline-card p { color: #526477; margin-top: 7px; }
.timeline-card small { display: block; color: #7d8c9e; margin-top: 8px; }
.record-detail .detail-grid { margin-top: 0; }
.record-block { padding: 13px 0; border-top: 1px solid var(--line); }
.record-block p { color: #4e6074; white-space: pre-wrap; margin-top: 5px; }
.toast { position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; color: #fff; background: #233a59; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); transition: .25s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .main-area { padding: 28px 24px 50px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid, .due-cards { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .sidebar { width: 72px; padding: 18px 10px; }
  .brand { padding: 0 0 20px; justify-content: center; }
  .brand > div:last-child, .tenant-note div, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .tenant-note { justify-content: center; padding: 12px 0; }
  .tenant-note .status-dot { width: 10px; height: 10px; }
  .nav-item { justify-content: center; padding: 12px 7px; }
  .nav-item span { font-size: 17px; }
  .security-tip, .user-meta, .chevron { display: none; }
  .user-card { justify-content: center; padding: 8px 0; }
  .main-area { width: calc(100% - 72px); margin-left: 72px; padding: 24px 16px 42px; }
  .topbar, .welcome-row, .page-actions-row { display: block; }
  .top-actions { margin-top: 16px; }
  .top-actions .primary-button { margin-left: auto; }
  .two-col { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search-box { max-width: none; flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 22px 18px; }
  .small-modal { margin-right: 0; border-radius: 0; }
}
