:root {
  --ac-blue: #3b73df;
  --ac-blue-strong: #356bdd;
  --ac-blue-soft: #edf4ff;
  --ac-ink: #1d2942;
  --ac-text: #47546e;
  --ac-muted: #8490a6;
  --ac-line: #e9edf4;
  --ac-surface: #ffffff;
  --ac-bg: #f7f9fc;
  --ac-red: #f05f67;
  --ac-yellow: #e2a13b;
  --ac-green: #3caf81;
  --ac-radius: 14px;
  --ac-shadow: 0 6px 18px rgba(36, 59, 99, 0.08);
  --ac-font: "Segoe UI", Inter, -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ac-ink);
  background: var(--ac-bg);
  font-family: var(--ac-font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.ac-app {
  min-height: 100vh;
  background: var(--ac-bg);
}

.ac-topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 76px;
  padding: 0 30px;
  background: var(--ac-surface);
  border-bottom: 1px solid var(--ac-line);
}

.ac-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 257px;
  color: #203052;
  font-size: 19px;
  font-weight: 700;
}

.ac-brand-mark {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #4f8dff, #356bdd);
  border-radius: 10px;
}

.ac-search {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 438px;
  height: 40px;
  padding: 0 15px;
  color: #a3adbd;
  background: #f5f7fb;
  border-radius: 11px;
}

.ac-search input {
  width: 100%;
  color: var(--ac-text);
  background: transparent;
  border: 0;
  outline: 0;
}

.ac-search input::placeholder { color: #a3adbd; }

.ac-topbar-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  color: var(--ac-text);
}

.ac-notification {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ac-text);
  background: transparent;
  border: 0;
}

.ac-notification-dot {
  position: absolute;
  top: 0;
  left: 10px;
  width: 6px;
  height: 6px;
  background: var(--ac-red);
  border: 2px solid #fff;
  border-radius: 50%;
}

.ac-avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ac-blue);
  font-size: 13px;
  font-weight: 700;
  background: #dde9ff;
  border-radius: 50%;
}

.ac-shell {
  display: flex;
  min-height: 100vh;
  padding-top: 76px;
}

.ac-sidebar {
  position: fixed;
  inset: 76px auto 0 0;
  z-index: 10;
  display: flex;
  width: 232px;
  flex-direction: column;
  padding: 45px 16px 24px;
  background: var(--ac-surface);
  border-right: 1px solid var(--ac-line);
}

.ac-section-label {
  margin: 0 15px 18px;
  color: var(--ac-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
}

.ac-nav { display: grid; gap: 4px; }

.ac-nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 44px;
  padding: 0 14px;
  color: var(--ac-text);
  text-decoration: none;
  border-radius: 10px;
}

.ac-nav-item:hover { background: #f7f9fc; }

.ac-nav-item.is-active {
  color: #376dd7;
  font-weight: 600;
  background: var(--ac-blue-soft);
}

.ac-nav-icon { width: 18px; height: 18px; flex: 0 0 18px; }

.ac-sidebar-divider {
  height: 1px;
  margin: 26px 14px 28px;
  background: #eef1f6;
}

.ac-quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  margin: 0 14px;
  padding: 0 11px;
  color: var(--ac-text);
  text-decoration: none;
  background: #f7f9fc;
  border-radius: 9px;
}

.ac-ai-link { margin-top: auto; color: #7e8a9f; background: #fafbfd; }
.ac-version { margin: 22px 15px 0; color: var(--ac-muted); font-size: 13px; }

.ac-main {
  width: min(100% - 232px, 1200px);
  margin-left: 232px;
  padding: 42px 44px 44px;
}

.ac-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 25px;
}

.ac-page-title { margin: 0 0 9px; font-size: 26px; line-height: 1.2; }
.ac-page-subtitle { margin: 0; color: var(--ac-muted); }
.ac-date { color: #6d7890; font-weight: 600; text-align: right; }
.ac-date small { display: block; margin-top: 8px; color: var(--ac-muted); font-weight: 400; }

.ac-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.ac-status-card,
.ac-panel {
  background: var(--ac-surface);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow);
}

.ac-status-card { min-height: 118px; padding: 24px 28px; }
.ac-status-card-head { display: flex; align-items: center; gap: 13px; color: var(--ac-ink); font-weight: 600; }
.ac-status-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; }
.ac-status-icon.is-blue { color: #4a82ea; background: #eaf2ff; }
.ac-status-icon.is-yellow { color: var(--ac-yellow); background: #fff4df; }
.ac-status-icon.is-purple { color: #785ce2; background: #f0ecff; }
.ac-status-card-main { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 0 49px; }
.ac-status-value { font-size: 29px; font-weight: 700; line-height: 1; }
.ac-status-unit { color: var(--ac-muted); font-size: 13px; }
.ac-status-meta { margin-left: auto; color: var(--ac-muted); font-size: 13px; }
.ac-status-meta strong { margin-left: 7px; font-size: 20px; color: var(--ac-blue); }
.ac-status-card.is-warning .ac-status-meta strong { color: var(--ac-yellow); }

.ac-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.ac-section-heading h2 { margin: 0; font-size: 18px; }
.ac-section-heading p { margin: 0 0 0 14px; color: var(--ac-muted); font-size: 13px; }
.ac-heading-left { display: flex; align-items: center; }
.ac-link { color: var(--ac-blue); text-decoration: none; }

.ac-task-panel { margin-bottom: 30px; padding: 0 24px; }
.ac-task-row { position: relative; display: grid; grid-template-columns: 16px 235px 1fr 82px; gap: 14px; align-items: center; min-height: 94px; border-bottom: 1px solid #eef1f5; }
.ac-task-row:last-child { border-bottom: 0; }
.ac-task-dot { width: 8px; height: 8px; border-radius: 50%; }
.ac-task-dot.is-danger { background: var(--ac-red); }
.ac-task-dot.is-warning { background: #edb548; }
.ac-task-dot.is-neutral { background: #b9c1ce; }
.ac-task-name { font-weight: 600; }
.ac-task-meta { display: block; margin-top: 8px; color: var(--ac-muted); font-size: 13px; }
.ac-task-due { color: var(--ac-muted); font-size: 13px; text-align: right; }
.ac-task-due.is-danger { color: #e34d5a; }
.ac-progress-line { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ac-progress-track { flex: 1; height: 9px; overflow: hidden; background: #edf1f7; border-radius: 5px; }
.ac-progress-fill { height: 100%; background: linear-gradient(90deg, #5b9bff, #3b72e8); border-radius: inherit; }
.ac-progress-fill.is-yellow { background: #f1bd55; }
.ac-progress-label { color: var(--ac-muted); font-size: 13px; }
.ac-task-action { justify-self: end; padding: 6px 10px; color: var(--ac-blue); font-size: 13px; background: var(--ac-blue-soft); border: 0; border-radius: 7px; }
.ac-task-action.is-yellow { color: #c78b24; background: #fff7e8; }

.ac-lower-grid { display: grid; grid-template-columns: 6fr 4fr; gap: 20px; margin-bottom: 20px; }
.ac-project-panel, .ac-weekly-panel { padding: 28px 26px; }
.ac-project { padding: 6px 0 21px; border-bottom: 1px solid #eef1f5; }
.ac-project:last-child { padding-bottom: 0; border-bottom: 0; }
.ac-project-head { display: flex; justify-content: space-between; align-items: center; }
.ac-project-name { font-weight: 600; }
.ac-project-meta { color: var(--ac-muted); font-size: 13px; }
.ac-project-progress { margin-top: 13px; }
.ac-project-progress-label { display: flex; justify-content: space-between; margin-top: 8px; color: var(--ac-muted); font-size: 13px; }
.ac-risk { display: block; margin-top: 11px; color: #e45d68; font-size: 13px; }
.ac-weekly-item { padding: 13px 0; }
.ac-weekly-item + .ac-weekly-item { border-top: 1px solid #eef1f5; }
.ac-weekly-status { display: block; margin-top: 9px; font-size: 13px; }
.ac-weekly-status.is-done { color: var(--ac-green); }
.ac-weekly-status.is-pending { color: var(--ac-yellow); }
.ac-submit { margin-top: 5px; padding: 9px 18px; color: #fff; background: var(--ac-blue); border: 0; border-radius: 8px; }

.ac-activity-panel { padding: 28px 26px 22px; }
.ac-activity-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 35px; padding-top: 18px; border-top: 1px solid #eef1f5; }
.ac-activity-item { display: flex; align-items: center; gap: 10px; color: var(--ac-text); font-size: 13px; }
.ac-activity-time { color: var(--ac-muted); }
.ac-activity-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--ac-blue); }
.ac-activity-dot.is-green { background: var(--ac-green); }
.ac-activity-dot.is-yellow { background: var(--ac-yellow); }

@media (max-width: 1100px) {
  .ac-brand { min-width: 210px; }
  .ac-search { width: min(36vw, 360px); }
  .ac-main { padding-right: 28px; padding-left: 28px; }
  .ac-task-row { grid-template-columns: 16px 200px 1fr 78px; }
}

@media (max-width: 820px) {
  .ac-topbar { padding: 0 16px; }
  .ac-brand { min-width: auto; }
  .ac-brand-name, .ac-notification span { display: none; }
  .ac-search { width: min(48vw, 300px); margin-left: 20px; }
  .ac-sidebar { width: 68px; padding: 30px 10px 18px; }
  .ac-sidebar .ac-section-label, .ac-nav-item span, .ac-quick-link span, .ac-version { display: none; }
  .ac-nav-item { justify-content: center; padding: 0; }
  .ac-sidebar-divider { margin: 22px 3px; }
  .ac-quick-link { justify-content: center; margin: 0; padding: 0; }
  .ac-ai-link { margin-top: auto; }
  .ac-main { width: calc(100% - 68px); margin-left: 68px; padding: 32px 18px; }
  .ac-status-grid, .ac-lower-grid { grid-template-columns: 1fr; }
  .ac-task-row { grid-template-columns: 12px 1fr auto; gap: 10px; padding: 14px 0; }
  .ac-task-progress { grid-column: 2 / -1; }
  .ac-task-due { grid-column: 3; grid-row: 1; }
  .ac-task-action { grid-column: 3; grid-row: 2; }
  .ac-activity-list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .ac-date { display: none; }
  .ac-page-title { font-size: 22px; }
  .ac-search { width: 42vw; }
  .ac-status-card { padding: 20px; }
  .ac-task-panel, .ac-project-panel, .ac-weekly-panel, .ac-activity-panel { padding-right: 18px; padding-left: 18px; }
}

/* Projects page */
.ac-project-toolbar { display: flex; align-items: center; gap: 18px; padding: 0 26px; min-height: 58px; background: var(--ac-surface); border-radius: 12px; box-shadow: var(--ac-shadow); }
.ac-project-tabs { display: flex; align-items: stretch; gap: 28px; height: 58px; }
.ac-project-tab { display: grid; place-items: center; position: relative; color: var(--ac-muted); text-decoration: none; }
.ac-project-tab.is-active { color: var(--ac-blue); font-weight: 600; }
.ac-project-tab.is-active::after { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; content: ""; background: var(--ac-blue); }
.ac-project-search { margin-left: auto; width: 244px; height: 34px; padding: 0 12px; color: var(--ac-muted); background: #f5f7fb; border: 0; border-radius: 8px; }
.ac-project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ac-project-card { padding: 28px 34px; background: var(--ac-surface); border-radius: var(--ac-radius); box-shadow: var(--ac-shadow); }
.ac-project-card-title { display: flex; align-items: center; gap: 13px; }
.ac-project-card-title h3 { margin: 0; font-size: 18px; }
.ac-project-card-subtitle { margin: 7px 0 0; color: var(--ac-muted); font-size: 13px; }
.ac-project-card-stats { display: flex; justify-content: space-between; margin-top: 28px; color: var(--ac-muted); font-size: 13px; }
.ac-project-card-stats .is-risk { color: var(--ac-red); }

/* Settings page */
.ac-settings-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 36px; }
.ac-settings-nav, .ac-settings-form { background: var(--ac-surface); border-radius: var(--ac-radius); box-shadow: var(--ac-shadow); }
.ac-settings-nav { padding: 28px 16px; }
.ac-settings-nav-title { margin: 0 12px 18px; color: var(--ac-muted); font-size: 13px; font-weight: 700; }
.ac-settings-nav-item { display: flex; align-items: center; height: 44px; padding: 0 24px; color: var(--ac-text); text-decoration: none; border-radius: 9px; }
.ac-settings-nav-item.is-active { color: #376dd7; font-weight: 600; background: var(--ac-blue-soft); }
.ac-settings-form { padding: 40px 32px 34px; }
.ac-settings-form h2 { margin: 0 0 8px; font-size: 18px; }
.ac-settings-form > p { margin: 0; color: var(--ac-muted); font-size: 13px; }
.ac-settings-field { margin-top: 28px; }
.ac-settings-field label { display: block; margin-bottom: 9px; color: var(--ac-ink); font-weight: 600; }
.ac-settings-field input, .ac-settings-field textarea { width: 100%; padding: 0 14px; color: var(--ac-ink); background: #f8fafd; border: 1px solid #dde4ef; border-radius: 8px; outline: 0; }
.ac-settings-field input { height: 42px; }
.ac-settings-field textarea { min-height: 64px; padding-top: 12px; resize: vertical; }
.ac-settings-field input:focus, .ac-settings-field textarea:focus { border-color: var(--ac-blue); box-shadow: 0 0 0 3px rgba(59, 115, 223, .12); }
.ac-settings-avatar { display: flex; align-items: center; gap: 18px; }
.ac-settings-avatar .ac-avatar { width: 68px; height: 68px; font-size: 14px; }
.ac-secondary-button { padding: 8px 15px; color: var(--ac-text); background: #f5f7fb; border: 0; border-radius: 8px; }
.ac-form-actions { display: flex; justify-content: flex-end; margin-top: 32px; }

@media (max-width: 820px) {
  .ac-project-grid, .ac-settings-layout { grid-template-columns: 1fr; }
  .ac-project-toolbar { overflow-x: auto; }
  .ac-settings-nav { display: flex; overflow-x: auto; gap: 4px; padding: 12px; }
  .ac-settings-nav-title { display: none; }
  .ac-settings-nav-item { white-space: nowrap; }
}
