:root {
  --navy-950: #111b32;
  --navy-900: #17233e;
  --navy-800: #22304e;
  --blue-700: #2457d6;
  --blue-600: #3267e3;
  --blue-100: #eaf0ff;
  --blue-50: #f4f7ff;
  --ink-900: #182238;
  --ink-700: #3f4b63;
  --ink-500: #6f7b91;
  --ink-400: #96a0b2;
  --line: #e5e9f0;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --green: #159a72;
  --green-bg: #e9f8f2;
  --orange: #d97a16;
  --orange-bg: #fff5e7;
  --red: #d94b52;
  --red-bg: #fff0f1;
  --purple: #7558d8;
  --purple-bg: #f1edff;
  --shadow: 0 8px 30px rgba(23, 35, 62, .06);
  --radius: 14px;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink-900); font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, select, input[type="checkbox"] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(50, 103, 227, .2); outline-offset: 1px; }
h1, h2, h3, p { margin: 0; }
svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { width: 244px; position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; color: #d9e1f1; background: linear-gradient(175deg, var(--navy-900), var(--navy-950)); border-right: 1px solid rgba(255,255,255,.04); }
.brand { height: 82px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand strong { display: block; color: white; font-size: 17px; letter-spacing: .5px; }
.brand small { display: block; margin-top: 2px; color: #7f90b2; font-size: 9px; letter-spacing: 2px; }
.brand-mark { width: 34px; height: 34px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px; border-radius: 10px; background: linear-gradient(135deg, #4d7cf0, #2857ce); box-shadow: 0 5px 15px rgba(31, 84, 209, .3); }
.brand-mark span { display: block; width: 4px; border-radius: 2px; background: #fff; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .85; }
.main-nav { padding: 24px 14px; }
.nav-caption { padding: 0 12px; margin-bottom: 10px; color: #6f80a2; font-size: 11px; letter-spacing: 1.5px; }
.nav-item { width: 100%; height: 46px; border: 0; border-radius: 9px; padding: 0 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; color: #9eacc7; background: transparent; text-align: left; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(60, 108, 227, .35), rgba(60, 108, 227, .14)); box-shadow: inset 3px 0 #5d88f2; }
.nav-item b { min-width: 24px; margin-left: auto; padding: 1px 6px; color: #91a3c5; background: rgba(255,255,255,.07); border-radius: 10px; font-size: 11px; font-weight: 500; text-align: center; }
.nav-item.active b { color: #dce7ff; background: rgba(112, 150, 241, .18); }
.sidebar-bottom { margin-top: auto; padding: 16px; }
.data-card { padding: 14px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(255,255,255,.035); }
.data-card-title { display: flex; align-items: center; gap: 7px; color: #d4deef; font-size: 12px; }
.data-card p { margin: 8px 0 10px; color: #7889aa; font-size: 11px; line-height: 1.65; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #36c999; box-shadow: 0 0 0 3px rgba(54,201,153,.12); }
.data-actions { display: flex; gap: 14px; }
.text-button { border: 0; padding: 0; color: #8fb0f8; background: none; font-size: 11px; }
.text-button:hover { color: white; }
.help-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; color: #899ab8; background: transparent; font-size: 12px; text-align: left; }
.help-button:hover { color: white; }
.user-card { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 14px 8px 2px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #496bc2; font-size: 11px; font-weight: 700; }
.user-card strong, .user-card small { display: block; }
.user-card strong { color: #d9e1ef; font-size: 12px; font-weight: 500; }
.user-card small { margin-top: 2px; color: #7182a1; font-size: 10px; }
.online-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #39c795; }

.main-area { min-height: 100vh; margin-left: 244px; }
.topbar { height: 66px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.topbar-left, .topbar-right, .breadcrumb { display: flex; align-items: center; }
.topbar-right { gap: 18px; }
.breadcrumb { gap: 9px; font-size: 12px; }
.breadcrumb span, .breadcrumb i { color: var(--ink-400); font-style: normal; }
.breadcrumb strong { font-weight: 500; }
.global-search, .filter-search { display: flex; align-items: center; gap: 8px; color: var(--ink-400); border: 1px solid var(--line); background: #f8f9fc; transition: .18s; }
.global-search { width: 285px; height: 36px; padding: 0 10px; border-radius: 8px; }
.global-search:focus-within, .filter-search:focus-within { border-color: #9cb5ee; background: white; box-shadow: 0 0 0 3px rgba(50,103,227,.07); }
.global-search svg, .filter-search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.global-search input, .filter-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink-900); background: transparent; font-size: 12px; cursor: text; }
.global-search kbd { padding: 1px 5px; border: 1px solid #dfe4ed; border-radius: 4px; color: #9aa4b6; background: white; font-family: inherit; font-size: 9px; }
.today { color: var(--ink-500); font-size: 12px; white-space: nowrap; }
.content { max-width: 1800px; margin: 0 auto; padding: 28px 30px 42px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 5px; color: var(--blue-600); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
.page-heading h1 { font-size: 26px; line-height: 1.35; letter-spacing: -.5px; }
.page-heading > div > p:last-child { margin-top: 6px; color: var(--ink-500); font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.update-badge { display: inline-flex; align-items: center; gap: 7px; margin-right: 5px; color: var(--ink-500); font-size: 11px; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 500; white-space: nowrap; transition: .16s ease; }
.button svg { width: 15px; height: 15px; }
.button.primary { color: white; border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 3px 8px rgba(50,103,227,.16); }
.button.primary:hover { border-color: var(--blue-700); background: var(--blue-700); }
.button.secondary { color: var(--ink-700); border-color: #dfe4ec; background: white; }
.button.secondary:hover, .button.ghost:hover { color: var(--blue-600); border-color: #b8c9ef; background: var(--blue-50); }
.button.ghost { color: var(--ink-500); border-color: transparent; background: transparent; }
.button.danger { color: var(--red); border-color: #f2c9cc; background: #fff; }
.button.small { min-height: 29px; padding: 5px 10px; font-size: 11px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--ink-500); background: transparent; }
.icon-button:hover { color: var(--ink-900); background: #f0f3f8; }
.menu-button { display: none; }
.link-button { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 3px; color: var(--blue-600); background: transparent; font-size: 11px; }
.link-button:hover { color: var(--blue-700); }
.link-button span { font-size: 15px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric-card { position: relative; overflow: hidden; min-height: 122px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(23,35,62,.025); }
.metric-card::after { content: ""; position: absolute; right: -20px; bottom: -34px; width: 100px; height: 100px; border-radius: 50%; background: var(--metric-soft); opacity: .65; }
.metric-button { width: 100%; color: inherit; text-align: left; cursor: pointer; font: inherit; transition: transform .18s, box-shadow .18s, border-color .18s; }
.metric-button:hover, .metric-button:focus-visible { transform: translateY(-2px); border-color: var(--metric-color); box-shadow: 0 8px 20px rgba(23,35,62,.09); outline: none; }
.metric-button .metric-top, .metric-button .metric-value, .metric-button .metric-foot { position: relative; z-index: 1; }
.date-filter-input { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-700); background: white; font-size: 11px; }
.permission-view-button { min-width: 68px; border: 1px solid var(--line); background: var(--surface-soft); }
.permission-view-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 18px 2px; }
.permission-view-list .tag { padding: 7px 10px; font-size: 12px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-500); font-size: 12px; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--metric-color); background: var(--metric-soft); }
.metric-icon svg { width: 17px; height: 17px; }
.metric-value { margin-top: 5px; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -1px; }
.metric-value small { margin-left: 5px; color: var(--ink-400); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.metric-foot { margin-top: 6px; color: var(--ink-400); font-size: 11px; }
.metric-foot strong { color: var(--metric-color); font-weight: 500; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .9fr); gap: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(23,35,62,.025); }
.panel-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #edf0f5; }
.panel-header h2 { font-size: 14px; font-weight: 600; }
.panel-header p { margin-top: 3px; color: var(--ink-400); font-size: 10px; }
.count-badge { min-width: 25px; padding: 2px 7px; border-radius: 12px; font-size: 11px; text-align: center; }
.count-badge.danger { color: var(--red); background: var(--red-bg); }
.current-task-panel { margin-top: 18px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 40px; padding: 9px 14px; color: var(--ink-500); background: #fafbfc; font-size: 10px; font-weight: 500; text-align: left; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #eff2f6; color: var(--ink-700); font-size: 11px; vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbff; }
.cell-title { color: var(--ink-900); font-size: 12px; font-weight: 500; }
.cell-sub { display: block; max-width: 280px; margin-top: 3px; overflow: hidden; color: var(--ink-400); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.code-button { border: 0; padding: 0; color: var(--blue-600); background: none; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; }
.code-button:hover { text-decoration: underline; }
.person { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.mini-avatar { width: 25px; height: 25px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--avatar-color, #4867ad); background: var(--avatar-bg, #eaf0fb); font-size: 10px; font-weight: 600; }
.progress-cell { min-width: 120px; }
.progress-line { display: flex; align-items: center; gap: 8px; }
.progress-track { height: 5px; flex: 1; min-width: 60px; overflow: hidden; border-radius: 5px; background: #e9edf4; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--blue-600); transition: width .35s ease; }
.progress-fill.green { background: var(--green); }
.progress-fill.orange { background: var(--orange); }
.progress-fill.red { background: var(--red); }
.progress-number { width: 30px; color: var(--ink-700); font-size: 10px; text-align: right; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 5px; font-size: 10px; white-space: nowrap; }
.tag.blue { color: var(--blue-700); background: var(--blue-100); }
.tag.green { color: var(--green); background: var(--green-bg); }
.tag.orange { color: var(--orange); background: var(--orange-bg); }
.tag.red { color: var(--red); background: var(--red-bg); }
.tag.gray { color: #68758b; background: #eff2f6; }
.tag.purple { color: var(--purple); background: var(--purple-bg); }
.tag.outline { color: var(--ink-500); border: 1px solid var(--line); background: white; }
.task-count-link { border: 0; padding: 3px 7px; border-radius: 5px; color: var(--blue-600); background: var(--blue-50); font-size: 10px; }
.task-count-link:hover { background: var(--blue-100); }
.muted { color: var(--ink-400); }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }
.nowrap { white-space: nowrap; }
.truncate { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-list { padding: 5px 18px 12px; }
.risk-item { padding: 14px 0; border-bottom: 1px solid #eff2f6; }
.risk-item:last-child { border-bottom: 0; }
.risk-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.risk-item h3 { font-size: 12px; font-weight: 500; }
.risk-item p { margin: 5px 0 8px; color: var(--ink-500); font-size: 10px; line-height: 1.6; }
.risk-meta { display: flex; align-items: center; justify-content: space-between; color: var(--ink-400); font-size: 10px; }
.empty-state { padding: 36px 16px; color: var(--ink-400); text-align: center; }
.empty-state svg { width: 30px; height: 30px; margin: 0 auto 10px; color: #bdc6d4; }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--ink-500); font-size: 12px; font-weight: 500; }
.empty-state p { font-size: 10px; }
.people-list { padding: 6px 18px 12px; }
.person-row { padding: 12px 0; border-bottom: 1px solid #eff2f6; }
.person-row:last-child { border-bottom: 0; }
.person-row-head { display: flex; align-items: center; gap: 9px; }
.person-row-head .mini-avatar { width: 30px; height: 30px; }
.person-name { min-width: 80px; }
.person-name strong { display: block; font-size: 11px; font-weight: 500; }
.person-name small { color: var(--ink-400); font-size: 9px; }
.person-stats { margin-left: auto; text-align: right; }
.person-stats strong { display: block; color: var(--blue-600); font-size: 12px; }
.person-stats small { color: var(--ink-400); font-size: 9px; }
.person-tasks { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.person-task { max-width: 100%; padding: 3px 7px; overflow: hidden; border: 0; border-radius: 4px; color: var(--ink-500); background: #f4f6fa; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.person-task:hover { color: var(--blue-600); background: var(--blue-100); }
.status-chart-wrap { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 24px 20px 18px; }
.donut { width: 126px; height: 126px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#e7ebf1 0 100%); }
.donut::before { content: ""; grid-area: 1 / 1; width: 84px; height: 84px; border-radius: 50%; background: white; }
.donut > div { z-index: 1; grid-area: 1 / 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 24px; }
.donut span { color: var(--ink-400); font-size: 9px; }
.chart-legend { min-width: 100px; display: grid; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 7px; width: 100%; border: 0; padding: 0; color: var(--ink-500); background: none; font-size: 10px; }
.legend-item:hover { color: var(--blue-600); }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; }
.legend-item b { margin-left: auto; color: var(--ink-700); font-weight: 600; }
.workload-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 18px 16px; padding: 12px 0; border-radius: 8px; background: #f7f9fc; text-align: center; }
.workload-strip > div + div { border-left: 1px solid var(--line); }
.workload-strip strong, .workload-strip span { display: block; }
.workload-strip strong { font-size: 13px; }
.workload-strip span { margin-top: 2px; color: var(--ink-400); font-size: 9px; }

.filter-bar { min-height: 60px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.filter-search { width: 310px; height: 34px; padding: 0 10px; border-radius: 7px; }
select, .form-control { height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-700); background-color: white; font-size: 11px; }
select { max-width: 180px; }
input[type="date"] { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-700); background: white; font-size: 11px; }
.filter-result { margin-left: auto; color: var(--ink-400); font-size: 10px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-500); font-size: 11px; white-space: nowrap; }
.checkbox-label input { accent-color: var(--blue-600); }
.table-panel { overflow: hidden; }
.data-table th { height: 45px; padding: 10px 13px; }
.data-table td { padding: 14px 13px; }
.data-table tbody tr { height: 66px; }
.data-table .actions { display: flex; gap: 3px; white-space: nowrap; }
.action-button { border: 0; padding: 4px 6px; border-radius: 5px; color: var(--blue-600); background: transparent; font-size: 10px; }
.action-button:hover { background: var(--blue-100); }
.action-button.danger { color: var(--red); }
.action-button.danger:hover { background: var(--red-bg); }
.wide-table table { min-width: 1550px; }
.wide-table table.requirement-full-table { min-width: 3850px; }
.wide-table table.task-full-table { min-width: 3650px; }
.wide-table table.weekly-full-table { min-width: 2750px; }
.wide-table th:first-child, .wide-table td:first-child { position: sticky; left: 0; z-index: 2; background: white; box-shadow: 1px 0 var(--line); }
.wide-table th:first-child { z-index: 3; background: #fafbfc; }
.wide-table tr:hover td:first-child { background: #fafbff; }
.auto-note { display: flex; align-items: center; gap: 7px; margin: -2px 0 12px; color: var(--ink-500); font-size: 10px; }
.auto-note svg { width: 14px; height: 14px; color: var(--blue-600); }
.link-banner { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 10px 14px; border: 1px solid #cfddfb; border-radius: 9px; color: #365da9; background: var(--blue-50); font-size: 11px; }
.link-banner svg { width: 15px; height: 15px; }
.link-banner button { margin-left: auto; border: 0; color: var(--blue-600); background: none; font-size: 11px; }
.week-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.week-stat { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.week-stat span { color: var(--ink-500); font-size: 11px; }
.week-stat strong { font-size: 18px; }
.week-stat small { margin-left: 3px; color: var(--ink-400); font-size: 9px; font-weight: 400; }

.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(14,24,44,.48); backdrop-filter: blur(3px); }
.modal-backdrop { display: grid; place-items: center; padding: 24px; }
.modal { width: min(880px, 96vw); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: white; box-shadow: 0 25px 80px rgba(10,20,40,.25); animation: modalIn .18s ease; }
.modal.small-modal { width: min(600px, 96vw); }
@keyframes modalIn { from { opacity: .5; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-header, .drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-header h2, .drawer-header h2 { font-size: 18px; }
#recordForm { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.modal-body { overflow-y: auto; padding: 22px 24px 26px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: #fafbfc; }
.form-section { margin-bottom: 24px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--ink-900); font-size: 12px; font-weight: 600; }
.form-section-title::before { content: ""; width: 3px; height: 13px; border-radius: 3px; background: var(--blue-600); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--ink-700); font-size: 11px; }
.form-group label .required { margin-left: 3px; color: var(--red); }
.form-group label small { color: var(--ink-400); font-size: 9px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; max-width: none; height: 38px; padding: 8px 10px; border: 1px solid #dfe4ec; border-radius: 7px; outline: 0; color: var(--ink-900); background: white; font-size: 12px; cursor: text; }
.form-group select { cursor: pointer; }
.form-group select[multiple] { height: 112px; padding: 5px; }
.form-group select[multiple] option { padding: 6px 8px; border-radius: 4px; }
.form-group select[multiple] option:checked { color: var(--blue-700); background: var(--blue-100); }
.form-group textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #8eaae9; box-shadow: 0 0 0 3px rgba(50,103,227,.08); }
.form-group input[readonly], .form-group select:disabled { color: var(--ink-500); background: #f5f7fa; cursor: not-allowed; }
.form-hint { display: block; margin-top: 5px; color: var(--ink-400); font-size: 9px; }
.help-content { color: var(--ink-700); font-size: 12px; line-height: 1.8; }
.help-content h3 { margin: 18px 0 6px; color: var(--ink-900); font-size: 13px; }
.help-content h3:first-child { margin-top: 0; }
.help-content ol, .help-content ul { margin: 6px 0; padding-left: 20px; }
.help-content code { padding: 1px 5px; border-radius: 4px; color: var(--blue-700); background: var(--blue-50); }
.help-callout { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--blue-600); color: var(--ink-500); background: var(--blue-50); }

.drawer-backdrop { display: flex; justify-content: flex-end; }
.drawer { width: min(680px, 94vw); height: 100%; display: flex; flex-direction: column; background: white; box-shadow: -15px 0 60px rgba(10,20,40,.2); animation: drawerIn .2s ease; }
@keyframes drawerIn { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-body { overflow-y: auto; padding: 22px 24px 35px; }
.detail-hero { padding: 18px; margin-bottom: 20px; border: 1px solid #dfe7f8; border-radius: 11px; background: linear-gradient(135deg, #f5f8ff, #fbfcff); }
.detail-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-hero h3 { font-size: 17px; }
.detail-hero p { margin-top: 6px; color: var(--ink-500); font-size: 11px; }
.detail-progress { margin-top: 16px; }
.detail-progress .progress-track { height: 7px; }
.detail-section { margin-top: 24px; }
.detail-section h3 { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 20px; }
.detail-item label { display: block; margin-bottom: 4px; color: var(--ink-400); font-size: 10px; }
.detail-item div { color: var(--ink-700); font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.detail-item.full { grid-column: 1 / -1; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.linked-records { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.linked-record { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.linked-record:last-child { border-bottom: 0; }
.linked-record strong { display: block; color: var(--ink-700); font-size: 11px; font-weight: 500; }
.linked-record small { display: block; margin-top: 2px; color: var(--ink-400); font-size: 9px; }

.toast-container { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: grid; gap: 10px; }
.toast { min-width: 260px; max-width: 380px; display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid #d9eee6; border-radius: 10px; color: #22634f; background: #f2fcf8; box-shadow: 0 10px 30px rgba(20,40,70,.14); font-size: 12px; animation: toastIn .2s ease; }
.toast.error { color: #a33b42; border-color: #f1d2d4; background: #fff6f6; }
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Cloud authentication and team collaboration */
.auth-gate { position: fixed; inset: 0; z-index: 1000; overflow-y: auto; color: white; background: radial-gradient(circle at 12% 10%, rgba(65,105,207,.24), transparent 34%), radial-gradient(circle at 85% 85%, rgba(37,170,140,.12), transparent 30%), linear-gradient(145deg, #111b32, #172540 58%, #101a30); }
.auth-brand { position: absolute; top: 30px; left: 42px; display: flex; align-items: center; gap: 12px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 17px; letter-spacing: .5px; }
.auth-brand small { margin-top: 2px; color: #7f91b5; font-size: 9px; letter-spacing: 2px; }
.auth-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: #aab8d2; }
.loading-spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.13); border-top-color: #6f96f5; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-layout { width: min(1080px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; padding: 110px 0 55px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 90px; }
.auth-badge { display: inline-flex; padding: 5px 10px; border: 1px solid rgba(129,161,241,.25); border-radius: 20px; color: #a9c1f7; background: rgba(88,126,217,.1); font-size: 11px; }
.auth-intro h1 { margin-top: 20px; font-size: 42px; line-height: 1.35; letter-spacing: -1.2px; }
.auth-intro > p { max-width: 480px; margin-top: 18px; color: #9aabc8; font-size: 14px; line-height: 1.9; }
.auth-features { display: grid; gap: 20px; margin-top: 42px; }
.auth-features > div { display: flex; align-items: center; gap: 14px; }
.auth-features b { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; color: #87a7ef; background: rgba(255,255,255,.035); font-size: 11px; }
.auth-features strong, .auth-features small { display: block; }
.auth-features strong { color: #e7edf8; font-size: 13px; font-weight: 500; }
.auth-features small { margin-top: 3px; color: #7789aa; font-size: 11px; }
.login-card { padding: 30px; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; color: var(--ink-900); background: rgba(255,255,255,.98); box-shadow: 0 25px 80px rgba(3,10,25,.3); }
.login-card h2 { font-size: 22px; }
.login-card > div > p:last-child { margin-top: 5px; color: var(--ink-500); font-size: 11px; }
#phoneLoginForm { margin-top: 25px; }
.login-label { display: block; margin: 13px 0 6px; color: var(--ink-700); font-size: 11px; }
.login-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dce2ec; border-radius: 8px; outline: none; color: var(--ink-900); background: white; font-size: 12px; }
.login-input:focus { border-color: #8ca8e8; box-shadow: 0 0 0 3px rgba(50,103,227,.08); }
.code-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.code-input-row .button { height: 42px; }
.login-submit { width: 100%; height: 42px; margin-top: 18px; }
.owner-setup-toggle { margin-top: 14px; color: var(--blue); }
.owner-setup-toggle:hover { color: var(--ink-900); }
#ownerSetupForm { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 19px 0; color: var(--ink-400); font-size: 10px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.wechat-button { width: 100%; height: 42px; color: white; background: #1aaa64; }
.wechat-button:hover { background: #149356; }
.login-error { min-height: 18px; margin-top: 10px; color: var(--red); font-size: 11px; }
.login-privacy { color: var(--ink-400); font-size: 9px; line-height: 1.6; text-align: center; }
.nav-caption-secondary { margin-top: 22px; }
.logout-button { width: 28px; height: 28px; display: grid; place-items: center; margin-left: auto; border: 0; border-radius: 6px; color: #7182a1; background: transparent; }
.logout-button:hover { color: white; background: rgba(255,255,255,.07); }
.logout-button svg { width: 15px; height: 15px; }
.cloud-sync-button { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 6px 8px; border-radius: 6px; color: var(--green); background: var(--green-bg); font-size: 10px; white-space: nowrap; }
.cloud-sync-button:hover { background: #dcf3ea; }
.cloud-sync-button.syncing svg { animation: spin .8s linear infinite; }
.cloud-sync-button.offline { color: var(--red); background: var(--red-bg); }
.audit-table { min-width: 1250px; }
.audit-action { min-width: 54px; text-align: center; }
.audit-summary { max-width: 360px; line-height: 1.65; }
.audit-time { white-space: nowrap; }
.audit-time small { display: block; margin-top: 2px; color: var(--ink-400); font-size: 9px; }
.audit-detail-hero { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: 10px; background: #f5f7fb; }
.audit-detail-hero .mini-avatar { width: 38px; height: 38px; }
.audit-detail-hero strong, .audit-detail-hero small { display: block; }
.audit-detail-hero small { margin-top: 3px; color: var(--ink-500); }
.change-list { display: grid; gap: 10px; }
.change-item { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.change-item h4 { margin: 0; padding: 8px 11px; color: var(--ink-700); background: #f7f9fc; font-size: 11px; font-weight: 500; }
.change-values { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.change-values > div { min-width: 0; padding: 10px 11px; }
.change-values > div + div { border-left: 1px solid var(--line); }
.change-values label { display: block; margin-bottom: 5px; color: var(--ink-400); font-size: 9px; }
.change-values pre { max-height: 180px; margin: 0; overflow: auto; color: var(--ink-700); font-family: inherit; font-size: 10px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.change-values .after { color: var(--blue-700); }
.import-callout { padding: 16px; border: 1px solid #dce6fa; border-radius: 10px; background: var(--blue-50); }
.import-callout h3 { margin-bottom: 7px; font-size: 14px; }
.import-callout p { color: var(--ink-500); font-size: 11px; line-height: 1.8; }
.import-callout .metric-line { display: flex; gap: 20px; margin: 14px 0; }
.import-callout .metric-line strong { color: var(--blue-700); }
.import-errors { max-height: 260px; margin-top: 10px; overflow-y: auto; color: var(--red); font-size: 10px; }
.import-errors p { padding: 4px 0; border-bottom: 1px solid #f3e2e3; }
.import-success { border-color: #bfe6d7; color: var(--green); background: var(--green-bg); }

.version-card { margin: 6px 8px 12px; padding: 10px 11px; border: 1px solid rgba(255,255,255,.07); border-radius: 8px; color: #7182a1; background: rgba(255,255,255,.025); font-size: 9px; }
.version-card > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.version-card strong { color: #a9bce4; font-size: 11px; }
.version-card span { color: #62769c; }
.version-card p + p { margin-top: 2px; }
.auth-pending { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; }
.pending-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; color: #9cb8f6; background: rgba(255,255,255,.05); }
.pending-icon svg { width: 28px; height: 28px; }
.auth-pending h2 { font-size: 24px; }
.auth-pending p { max-width: 430px; margin: 12px 0 24px; color: #93a5c3; line-height: 1.8; }
.auth-pending .button { color: #dce6f9; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); }
.pending-actions { display: flex; gap: 10px; }
.material-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue-600); text-decoration: none; }
.material-link:hover { text-decoration: underline; }
.material-link svg { width: 13px; height: 13px; }
.attachment-input { padding: 8px !important; height: auto !important; }
.attachment-preview { display: flex; align-items: center; gap: 8px; margin-top: 7px; padding: 7px 9px; border-radius: 6px; color: var(--ink-500); background: #f4f6fa; font-size: 10px; }
.config-options { max-width: 420px; white-space: normal; line-height: 1.8; }
.config-options .tag { margin: 2px 3px 2px 0; }
.member-pending-row { background: #fffcf5; }
.member-current { color: var(--blue-600); font-size: 9px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.permission-option { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.permission-option:has(input:checked) { border-color: #b7c9f2; background: var(--blue-50); }
.permission-option input { width: 16px; height: 16px; accent-color: var(--blue-600); }
.permission-option strong, .permission-option small { display: block; }
.permission-option strong { color: var(--ink-700); font-size: 11px; }
.permission-option small { margin-top: 2px; color: var(--ink-400); font-size: 9px; }

.close-prompt { z-index: 2200; }
.online-members-button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink-600); background: white; font-size: 10px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(21,154,114,.1); }
.network-banner { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid #efc5c8; border-radius: 8px; color: var(--red); background: var(--red-bg); font-size: 11px; }
.network-banner svg { width: 17px; height: 17px; }
.last-sync { color: var(--ink-400); font-size: 9px; white-space: nowrap; }
body.offline .actions, body.offline .add-button { pointer-events: none; opacity: .45; }
.account-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink-700); background: white; font-size: 11px; }
.account-chip:hover { border-color: #b7c9f2; background: var(--blue-50); }
.account-chip .avatar { width: 26px; height: 26px; font-size: 9px; }
.version-note { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.06); line-height: 1.55; }
.login-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 20px; padding: 4px; border-radius: 9px; background: #f0f3f8; }
.login-mode-tabs button { height: 34px; border: 0; border-radius: 6px; color: var(--ink-500); background: transparent; font-size: 11px; }
.login-mode-tabs button.active { color: var(--blue-700); background: white; box-shadow: 0 2px 7px rgba(20,40,70,.08); font-weight: 600; }
.login-mode-hint { min-height: 28px; margin: 8px 0 12px !important; color: var(--ink-400); font-size: 9px !important; line-height: 1.6; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 14px 0 16px; border-bottom: 1px solid var(--line); }
.auth-tabs button { position: relative; height: 38px; border: 0; color: var(--ink-500); background: transparent; font-size: 12px; }
.auth-tabs button.active { color: var(--blue-700); font-weight: 600; }
.auth-tabs button.active::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue-600); }
.login-wechat-hint { min-height: 16px; margin: 8px 0 0; color: var(--ink-400); font-size: 9px; line-height: 1.6; text-align: center; }
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; }
.ai-chat-panel { min-height: 650px; display: flex; flex-direction: column; }
.ai-messages { height: 490px; flex: 1; overflow-y: auto; padding: 22px; background: linear-gradient(#fbfcfe, #f7f9fc); }
.ai-message { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.ai-message.user { flex-direction: row-reverse; }
.ai-avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: white; background: linear-gradient(135deg, #775cd8, #476ed7); font-size: 10px; font-weight: 700; }
.ai-message.user .ai-avatar { border-radius: 50%; background: var(--blue-600); }
.ai-bubble { max-width: 82%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; background: white; box-shadow: 0 2px 8px rgba(23,35,62,.035); }
.ai-message.user .ai-bubble { color: white; border-color: var(--blue-600); border-radius: 12px 4px 12px 12px; background: var(--blue-600); }
.ai-bubble strong { display: block; margin-bottom: 5px; font-size: 11px; }
.ai-bubble p { color: var(--ink-700); font-size: 12px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.ai-message.user .ai-bubble p { color: white; }
.ai-bubble.loading p { color: var(--ink-400); }
.ai-composer { padding: 15px 18px; border-top: 1px solid var(--line); }
.ai-composer textarea { width: 100%; min-height: 75px; padding: 10px 12px; border: 1px solid #dfe4ec; border-radius: 8px; outline: none; resize: vertical; color: var(--ink-900); font-size: 12px; line-height: 1.7; }
.ai-composer textarea:focus { border-color: #91aceb; box-shadow: 0 0 0 3px rgba(50,103,227,.07); }
.ai-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.ai-composer-footer > span { color: var(--ink-400); font-size: 9px; }
.ai-composer-footer > div { display: flex; gap: 6px; }
.ai-tools { display: grid; align-content: start; gap: 13px; }
.ai-tool-card { padding: 18px; }
.ai-tool-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 9px; }
.ai-tool-icon.blue { color: var(--blue-600); background: var(--blue-100); }
.ai-tool-icon.red { color: var(--red); background: var(--red-bg); }
.ai-tool-icon.green { color: var(--green); background: var(--green-bg); }
.ai-tool-card h3 { font-size: 13px; }
.ai-tool-card p { min-height: 48px; margin: 6px 0 13px; color: var(--ink-500); font-size: 10px; line-height: 1.65; }
.ai-tool-card label { display: block; margin-bottom: 5px; color: var(--ink-500); font-size: 10px; }
.ai-tool-card input { width: 100%; margin-bottom: 10px; }
.ai-tool-card .button { width: 100%; }
#aiModelSelect { min-width: 150px; }

@media (max-width: 1250px) {
  .today { display: none; }
  .global-search { width: 240px; }
  .metric-grid { gap: 12px; }
  .metric-card { padding: 16px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); }
  .status-chart-wrap { gap: 16px; }
  .donut { width: 110px; height: 110px; }
  .donut::before { width: 74px; height: 74px; }
}
@media (max-width: 1024px) {
  .sidebar { width: 214px; }
  .main-area { margin-left: 214px; }
  .content, .topbar { padding-left: 20px; padding-right: 20px; }
  .topbar-right { gap: 10px; }
  .global-search { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .ai-layout { grid-template-columns: 1fr; }
  .ai-tools { grid-template-columns: repeat(3, 1fr); }
  .ai-tools .auto-note { grid-column: 1 / -1; }
  .filter-search { width: 260px; }
  .week-overview { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { width: 244px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 10px 0 40px rgba(10,20,40,.25); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .menu-button { display: inline-grid; margin-right: 8px; }
  .topbar { height: 60px; padding: 0 14px; }
  .breadcrumb > span, .breadcrumb i { display: none; }
  .topbar .button { padding: 8px 10px; font-size: 11px; }
  .content { padding: 20px 14px 30px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-heading h1 { font-size: 23px; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .update-badge { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 110px; padding: 14px; }
  .metric-value { font-size: 25px; }
  .metric-foot { font-size: 9px; }
  .metric-top { font-size: 10px; }
  .filter-bar { align-items: stretch; padding: 10px; }
  .filter-search { width: 100%; }
  .filter-bar select { flex: 1; max-width: none; }
  .filter-result { width: 100%; margin: 0; text-align: right; }
  .week-overview { gap: 8px; }
  .week-stat { padding: 11px; }
  .week-stat span { font-size: 9px; }
  .week-stat strong { font-size: 15px; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: 95vh; }
  .modal-header, .drawer-header { padding: 16px 18px; }
  .modal-body, .drawer-body { padding: 18px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-group.full, .detail-item.full { grid-column: auto; }
  .toast-container { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
}
@media (max-width: 760px) {
  .auth-brand { top: 22px; left: 24px; }
  .auth-layout { grid-template-columns: 1fr; gap: 35px; padding: 105px 0 35px; }
  .auth-intro h1 { font-size: 32px; }
  .auth-intro > p { font-size: 12px; }
  .auth-features { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 25px; }
  .auth-features > div { align-items: flex-start; gap: 7px; }
  .auth-features b { width: 26px; height: 26px; flex: 0 0 auto; }
  .auth-features small { display: none; }
  .auth-features strong { font-size: 10px; }
  .login-card { padding: 22px; }
  .cloud-sync-button span:last-child { display: none; }
  .ai-tools { grid-template-columns: 1fr; }
  .ai-chat-panel { min-height: 600px; }
  .ai-messages { height: 420px; padding: 14px; }
  .ai-bubble { max-width: 92%; }
  .ai-composer-footer > span { display: none; }
  .ai-composer-footer { justify-content: flex-end; }
}
@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 100px; }
  .week-overview { grid-template-columns: 1fr 1fr; }
  .topbar .button svg { display: none; }
}
