:root {
  --ink: #15211c;
  --muted: #68736d;
  --line: #e4e9e5;
  --canvas: #f4f7f5;
  --panel: #ffffff;
  --green-950: #0d2c21;
  --green-900: #123b2c;
  --green-800: #17523d;
  --green-700: #1f6b50;
  --green-600: #298366;
  --green-100: #e4f3ec;
  --green-50: #f1f8f4;
  --orange: #d7752d;
  --orange-100: #fff0e4;
  --red: #bf4b4b;
  --red-100: #fbe9e9;
  --blue: #3973a8;
  --blue-100: #eaf2fa;
  --yellow-100: #fff7d9;
  --shadow: 0 10px 32px rgba(22, 55, 41, .07);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 232px; flex-direction: column; padding: 24px 16px; color: #eaf5ef; background: linear-gradient(180deg, var(--green-950), #0a241b); box-shadow: 10px 0 30px rgba(8, 37, 27, .08); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; color: #153a2c; background: #dff2e7; font-weight: 800; font-size: 18px; }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { color: #fff; font-size: 15px; letter-spacing: .02em; }
.brand-copy small { color: #8eb2a4; font-size: 11px; }
.nav { display: grid; gap: 7px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 13px; border: 0; border-radius: 10px; color: #9fb9af; background: transparent; text-align: left; transition: .2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: rgba(91, 164, 130, .22); box-shadow: inset 3px 0 0 #75bd98; }
.nav-icon { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; font-size: 12px; }
.nav-item.active .nav-icon { color: #dff5e9; border-color: rgba(175, 224, 199, .35); }
.sidebar-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(255,255,255,.04); }
.tip-dot { width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: #f0aa64; box-shadow: 0 0 0 4px rgba(240,170,100,.12); }
.sidebar-tip div { display: grid; gap: 4px; }
.sidebar-tip strong { font-size: 12px; font-weight: 600; }
.sidebar-tip small { color: #8eaa9f; font-size: 10px; line-height: 1.55; }

.main-content { min-height: 100vh; margin-left: 232px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 66px; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: #87908b; font-size: 12px; }
.breadcrumb b { color: #c6cbc8; font-weight: 400; }
.breadcrumb strong { color: var(--ink); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 13px; }
.today { color: #7b8580; font-size: 12px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #53605a; background: #fff; font-size: 18px; transition: .18s; }
.icon-button:hover { color: var(--green-700); border-color: #bfd5ca; background: var(--green-50); }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 20px; }
.page-container { width: min(100%, 1480px); margin: 0 auto; padding: 30px 32px 54px; }
.page { display: none; animation: enter .25s ease; }
.page.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.hero-panel { position: relative; display: flex; min-height: 178px; align-items: flex-end; justify-content: space-between; overflow: hidden; padding: 29px 34px; border-radius: 17px; color: #fff; background: linear-gradient(112deg, #123d2c 0%, #1b6048 60%, #2b785b 100%); box-shadow: 0 14px 35px rgba(19,70,51,.16); }
.hero-panel::after { position: absolute; width: 300px; height: 300px; right: -80px; top: -160px; border: 45px solid rgba(255,255,255,.055); border-radius: 50%; content: ""; }
.eyebrow { display: block; margin-bottom: 8px; color: #99c6b1; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.eyebrow.dark { color: var(--green-600); }
.hero-panel h1, .page-heading h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.hero-panel p { max-width: 660px; margin: 10px 0 0; color: #c2d9cf; font-size: 13px; line-height: 1.7; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; }
.button { min-height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 600; font-size: 13px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green-700); box-shadow: 0 5px 15px rgba(26,100,73,.18); }
.button-primary:hover { background: var(--green-800); }
.button-secondary { color: #eaf7f0; border-color: rgba(255,255,255,.23); background: rgba(255,255,255,.08); }
.button-light { color: var(--green-900); background: #eff8f3; }
.button-ghost { color: #59635e; border-color: var(--line); background: #fff; }
.button-danger { color: #fff; background: var(--red); }
.button-danger:hover { background: #a63e3e; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 17px 0; }
.metric-card { position: relative; min-height: 122px; padding: 20px 21px; overflow: hidden; border: 1px solid #e7ebe8; border-radius: var(--radius); background: var(--panel); box-shadow: 0 4px 18px rgba(22,55,41,.035); }
.metric-card::after { position: absolute; right: -25px; bottom: -31px; width: 91px; height: 91px; border-radius: 50%; background: var(--tint); content: ""; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #6e7873; font-size: 12px; }
.metric-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--accent); background: var(--tint); font-size: 12px; font-weight: 700; }
.metric-value { display: flex; align-items: baseline; gap: 5px; margin-top: 10px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 700; }
.metric-value small { color: #89918d; font-family: inherit; font-size: 11px; font-weight: 400; }
.metric-sub { position: absolute; z-index: 1; right: 17px; bottom: 15px; color: var(--accent); font-size: 10px; font-weight: 600; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .8fr); gap: 17px; margin-bottom: 17px; }
.panel { border: 1px solid #e6ebe7; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel-header { display: flex; min-height: 78px; align-items: center; justify-content: space-between; padding: 17px 21px; border-bottom: 1px solid #edf0ee; }
.panel-header h2 { margin: 0 0 5px; font-size: 15px; }
.panel-header p { margin: 0; color: #88918c; font-size: 11px; }
.text-button { border: 0; color: var(--green-700); background: transparent; font-size: 11px; font-weight: 600; }
.attention-list { min-height: 270px; }
.attention-row { display: grid; grid-template-columns: 1.4fr .9fr .85fr 1.5fr; gap: 14px; align-items: center; padding: 14px 21px; border-bottom: 1px solid #f0f2f1; }
.attention-row:last-child { border-bottom: 0; }
.identity { display: flex; min-width: 0; align-items: center; gap: 10px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--green-800); background: var(--green-100); font-weight: 700; }
.identity-copy { min-width: 0; }
.identity-copy strong, .primary-text { display: block; overflow: hidden; color: #24302a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy small, .secondary-text { display: block; margin-top: 4px; overflow: hidden; color: #8a938e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.platform-pill { display: inline-flex; align-items: center; gap: 5px; color: #4a5650; font-size: 11px; }
.platform-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, #607b6d); }
.followup-copy { overflow: hidden; color: #65706a; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-chip::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-joined, .status-active { color: #247052; background: #e7f4ed; }
.status-pending { color: #9b6b17; background: var(--yellow-100); }
.status-not_joined, .status-expired { color: #b44c43; background: var(--red-100); }
.status-inactive, .status-terminated { color: #6c7570; background: #eef0ef; }
.responsibility-list { padding: 14px 21px 19px; }
.responsibility-row { margin-bottom: 17px; }
.responsibility-row:last-child { margin-bottom: 0; }
.responsibility-copy { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.responsibility-copy strong { font-size: 11px; }
.responsibility-copy span { color: #79837e; font-size: 10px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #edf1ee; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-700), #5ea581); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; color: #7a847f; background: #fafbfa; font-size: 10px; font-weight: 600; letter-spacing: .02em; text-align: left; white-space: nowrap; }
td { padding: 15px 16px; border-top: 1px solid #edf0ee; color: #5e6963; font-size: 11px; vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbfdfc; }
.compact-table th, .compact-table td { padding-left: 21px; padding-right: 21px; }
.table-actions { display: flex; justify-content: flex-end; gap: 3px; }
.row-action { padding: 5px 7px; border: 0; border-radius: 6px; color: #78827d; background: transparent; font-size: 11px; }
.row-action:hover { color: var(--green-700); background: var(--green-50); }
.row-action.danger:hover { color: var(--red); background: var(--red-100); }
.clickable { cursor: pointer; }
.clickable:hover .primary-text { color: var(--green-700); }
.number-text { color: #35413b; font-variant-numeric: tabular-nums; font-weight: 600; }
.date-urgent { color: var(--red); font-weight: 600; }
.date-soon { color: var(--orange); font-weight: 600; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 23px; }
.page-heading p { margin: 8px 0 0; color: #78837d; font-size: 12px; }
.filter-bar { display: grid; grid-template-columns: minmax(260px, 1.7fr) repeat(5, minmax(120px, .75fr)) auto; gap: 9px; margin-bottom: 13px; }
.filter-bar.account-filters { grid-template-columns: minmax(280px, 1.6fr) minmax(140px, .6fr) minmax(140px, .6fr) auto; }
.filter-bar.contract-filters { grid-template-columns: minmax(300px, 1.5fr) minmax(160px, .5fr) auto; }
.search-field { position: relative; }
.search-field span { position: absolute; left: 13px; top: 10px; color: #83908a; font-size: 16px; }
.filter-bar input, .filter-bar select { width: 100%; height: 39px; border: 1px solid #dfe5e1; border-radius: 9px; outline: none; background: #fff; font-size: 11px; }
.filter-bar input { padding: 0 12px 0 35px; }
.filter-bar select { padding: 0 30px 0 11px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #84ad98; box-shadow: 0 0 0 3px rgba(53,130,94,.08); }
.filter-clear { height: 39px; padding: 0 12px; border: 0; color: var(--green-700); background: transparent; font-size: 11px; }
.list-panel { min-height: 380px; box-shadow: 0 5px 24px rgba(26,59,44,.05); }
.list-summary { display: flex; height: 54px; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid #edf0ee; }
.list-summary span { color: #37433d; font-size: 12px; font-weight: 600; }
.list-summary small { color: #8c9590; font-size: 10px; }
.empty-state { display: grid; min-height: 290px; place-items: center; padding: 30px; text-align: center; }
.empty-state.hidden, .hidden { display: none !important; }
.empty-content { max-width: 360px; }
.empty-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 13px; place-items: center; border-radius: 16px; color: var(--green-700); background: var(--green-100); font-size: 20px; }
.empty-content h3 { margin: 0 0 7px; font-size: 15px; }
.empty-content p { margin: 0 0 16px; color: #84908a; font-size: 11px; line-height: 1.7; }
.pagination { display: flex; min-height: 56px; align-items: center; justify-content: flex-end; gap: 7px; padding: 9px 16px; border-top: 1px solid #edf0ee; }
.pagination:empty { display: none; }
.pagination span { margin-right: 5px; color: #87918c; font-size: 10px; }
.page-button { min-width: 31px; height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: #65716b; background: #fff; font-size: 10px; }
.page-button:hover:not(:disabled), .page-button.active { color: #fff; border-color: var(--green-700); background: var(--green-700); }
.page-button:disabled { cursor: default; opacity: .38; }

.drawer-backdrop, .modal-backdrop, .confirm-backdrop { position: fixed; inset: 0; z-index: 50; visibility: hidden; opacity: 0; background: rgba(8, 24, 18, .36); transition: .22s ease; }
.drawer-backdrop.open, .modal-backdrop.open, .confirm-backdrop.open { visibility: visible; opacity: 1; }
.detail-drawer { position: fixed; z-index: 51; top: 0; right: 0; width: min(620px, 94vw); height: 100vh; overflow: auto; transform: translateX(102%); background: #f7f9f8; box-shadow: -16px 0 45px rgba(9,34,24,.18); transition: transform .26s ease; }
.detail-drawer.open { transform: none; }
.drawer-header { position: sticky; z-index: 2; top: 0; display: flex; height: 62px; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); font-size: 12px; font-weight: 600; }
.drawer-content { padding: 20px; }
.profile-card { padding: 22px; border-radius: 15px; color: #fff; background: linear-gradient(125deg, #153f30, #287254); }
.profile-top { display: flex; align-items: center; gap: 15px; }
.profile-avatar { display: grid; width: 56px; height: 56px; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 16px; background: rgba(255,255,255,.13); font-size: 21px; font-weight: 700; }
.profile-card h2 { margin: 0; font-size: 20px; }
.profile-card p { margin: 6px 0 0; color: #c1ded1; font-size: 11px; }
.profile-actions { display: flex; gap: 8px; margin-left: auto; }
.profile-actions button { padding: 7px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #fff; background: rgba(255,255,255,.08); font-size: 10px; }
.profile-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.profile-meta small { display: block; color: #9fc4b3; font-size: 9px; }
.profile-meta strong { display: block; margin-top: 4px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-section { margin-top: 15px; padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.drawer-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.drawer-section-header h3 { margin: 0; font-size: 13px; }
.drawer-section-header button { border: 0; color: var(--green-700); background: transparent; font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.detail-item small { display: block; margin-bottom: 4px; color: #909994; font-size: 9px; }
.detail-item span { color: #404b45; font-size: 11px; line-height: 1.5; }
.nested-card { padding: 13px; border: 1px solid #e7ebe8; border-radius: 10px; background: #fcfdfc; }
.nested-card + .nested-card { margin-top: 9px; }
.nested-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nested-card strong { font-size: 11px; }
.nested-card p { margin: 8px 0 0; color: #7b8580; font-size: 10px; line-height: 1.55; }
.nested-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 9px; color: #6f7a74; font-size: 9px; }

.modal-backdrop, .confirm-backdrop { display: grid; place-items: center; padding: 20px; }
.modal { width: min(690px, 96vw); max-height: 92vh; overflow: auto; transform: translateY(8px) scale(.99); border-radius: 16px; background: #fff; box-shadow: 0 25px 70px rgba(7,34,23,.22); transition: transform .2s ease; }
.modal-backdrop.open .modal { transform: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 23px 17px; border-bottom: 1px solid var(--line); }
.modal-kicker { display: block; margin-bottom: 5px; color: var(--green-600); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 21px 23px; }
.form-group { display: grid; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { color: #56615b; font-size: 10px; font-weight: 600; }
.required::after { margin-left: 3px; color: var(--red); content: "*"; }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1px solid #dfe5e1; border-radius: 8px; outline: none; background: #fff; font-size: 12px; }
.form-group input, .form-group select { height: 40px; padding: 0 11px; }
.form-group textarea { min-height: 78px; padding: 10px 11px; resize: vertical; line-height: 1.55; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #7fab95; box-shadow: 0 0 0 3px rgba(39,118,84,.08); }
.form-hint { margin-top: -2px; color: #98a09c; font-size: 9px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 23px; border-top: 1px solid var(--line); background: #fafbfa; }
.confirm-dialog { width: min(390px, 92vw); padding: 27px; transform: scale(.98); border-radius: 15px; background: #fff; box-shadow: 0 25px 70px rgba(7,34,23,.22); text-align: center; transition: transform .2s; }
.confirm-backdrop.open .confirm-dialog { transform: none; }
.confirm-icon { display: grid; width: 43px; height: 43px; margin: 0 auto 13px; place-items: center; border-radius: 50%; color: var(--red); background: var(--red-100); font-weight: 800; }
.confirm-dialog h3 { margin: 0 0 8px; font-size: 16px; }
.confirm-dialog p { margin: 0 0 20px; color: #7c8781; font-size: 11px; line-height: 1.6; }
.confirm-dialog div { display: flex; justify-content: center; gap: 9px; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; width: min(350px, calc(100vw - 44px)); gap: 9px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid #dce7e1; border-radius: 10px; color: #334039; background: #fff; box-shadow: 0 12px 35px rgba(17,53,37,.16); animation: toast-in .25s ease; font-size: 11px; line-height: 1.5; }
.toast::before { display: grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--green-600); content: "✓"; font-size: 10px; }
.toast.error::before { background: var(--red); content: "!"; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }
.loading-line { height: 11px; overflow: hidden; border-radius: 7px; background: linear-gradient(90deg, #edf1ee 25%, #f7f9f8 50%, #edf1ee 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 2; }
}
@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .mobile-menu { display: block; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .page-container { padding: 24px 20px 45px; }
  .topbar { padding: 0 20px; }
}
@media (max-width: 680px) {
  .today { display: none; }
  .hero-panel { min-height: 235px; align-items: flex-start; flex-direction: column; padding: 25px; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 112px; padding: 16px; }
  .metric-value { font-size: 25px; }
  .attention-row { grid-template-columns: 1fr 1fr; }
  .followup-copy { grid-column: 1 / -1; }
  .page-heading { align-items: flex-start; gap: 16px; flex-direction: column; }
  .filter-bar, .filter-bar.account-filters, .filter-bar.contract-filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .modal-body { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .profile-top { align-items: flex-start; flex-wrap: wrap; }
  .profile-actions { width: 100%; margin-left: 0; }
  .profile-meta { grid-template-columns: 1fr 1fr; }
  .page-container { padding: 20px 12px 40px; }
  .topbar { padding: 0 12px; }
}
