:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-soft: #f1f4f1;
  --ink: #1f2724;
  --muted: #6f7874;
  --muted-light: #98a09d;
  --line: #e3e7e4;
  --green: #2f6b58;
  --green-dark: #245244;
  --green-soft: #eaf3ef;
  --amber: #a66d21;
  --amber-soft: #fff5e5;
  --blue: #486f91;
  --blue-soft: #edf4f9;
  --red: #a6534d;
  --red-soft: #fff0ee;
  --shadow: 0 18px 54px rgba(32, 46, 40, .07);
  --shadow-soft: 0 8px 24px rgba(32, 46, 40, .05);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(47, 107, 88, .18);
  outline-offset: 2px;
}

.app-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 72px; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: white; background: var(--green); font-size: 15px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { margin-top: 1px; color: var(--muted-light); font-size: 10px; letter-spacing: .08em; }

.main-nav { display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 12px; background: #ecefec; }
.nav-item { min-width: 104px; padding: 9px 15px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 14px; font-weight: 600; }
.nav-item.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 7px rgba(26, 38, 33, .07); }

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-light); font-size: 12px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: #6b9d78; box-shadow: 0 0 0 3px #e7f0e8; }
.avatar { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--green-dark); background: #dfeae5; font-size: 11px; font-weight: 700; }

main { padding-top: 48px; }
.view { display: none; }
.view.is-active { display: block; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: .35; transform: translateY(3px); } }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.18; letter-spacing: -.035em; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.primary-button, .secondary-button, .text-button, .icon-button {
  border: 0;
  font-weight: 650;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; padding: 0 18px; border-radius: 12px; color: white; background: var(--green); box-shadow: 0 7px 18px rgba(47, 107, 88, .17); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.secondary-button:hover { border-color: #cbd3ce; background: #fbfcfb; }
.text-button { padding: 7px 0; color: var(--green); background: transparent; font-size: 13px; }
.text-button:hover { color: var(--green-dark); }
.icon-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 18px; }
.icon-button:hover { color: var(--green); border-color: #c9d9d2; background: var(--green-soft); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr) 1.4fr; gap: 14px; margin-bottom: 42px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-height: 112px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.stat-icon { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 12px; font-size: 18px; font-weight: 700; }
.icon-paper { color: var(--green); background: var(--green-soft); }
.icon-clock { color: var(--amber); background: var(--amber-soft); }
.icon-chat { color: var(--blue); background: var(--blue-soft); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: inline-block; margin: 2px 5px 0 0; font-size: 28px; line-height: 1.2; letter-spacing: -.03em; }
.stat-card small { display: inline; }
.focus-card { justify-content: space-between; color: white; border-color: transparent; background: var(--green); box-shadow: 0 15px 36px rgba(36, 82, 68, .18); }
.focus-card span, .focus-card small { color: rgba(255,255,255,.7); }
.focus-card strong { display: block; margin-top: 3px; }
.goal-ring { --progress: 0deg; display: grid; width: 66px; height: 66px; place-items: center; border-radius: 50%; background: conic-gradient(#fff var(--progress), rgba(255,255,255,.18) 0); }
.goal-ring::before { content: ""; position: absolute; width: 52px; height: 52px; border-radius: 50%; background: var(--green); }
.goal-ring span { position: relative; z-index: 1; color: white; font-size: 12px; font-weight: 700; }

.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-heading h2 { margin-bottom: 3px; font-size: 18px; letter-spacing: -.015em; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.board-heading { margin-bottom: 16px; }

.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.board-column { min-height: 420px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .5); }
.column-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.column-title { display: flex; align-items: center; gap: 8px; }
.column-title h3 { margin: 0; font-size: 15px; }
.column-title em { display: grid; min-width: 21px; height: 21px; padding: 0 6px; place-items: center; border-radius: 10px; color: var(--muted); background: #e9edea; font-size: 10px; font-style: normal; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.green { background: #5b927c; }
.status-dot.amber { background: #d89b4d; }
.status-dot.blue { background: #6b91b2; }
.card-list { display: grid; gap: 10px; }

.task-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 14px rgba(32, 46, 40, .035); }
.task-card:hover { border-color: #d4ddd8; }
.task-card.is-complete .task-main h4, .task-card.is-complete .task-main p { color: var(--muted-light); text-decoration: line-through; }
.task-check { display: grid; width: 20px; height: 20px; margin-top: 1px; place-items: center; border: 1.5px solid #bfc9c4; border-radius: 6px; color: transparent; background: white; font-size: 12px; }
.task-check:hover { border-color: var(--green); }
.is-complete .task-check { color: white; border-color: var(--green); background: var(--green); }
.task-main { min-width: 0; }
.task-main h4 { margin: 0 0 5px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.task-main p { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border-radius: 7px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 650; }
.tag.amber { color: var(--amber); background: var(--amber-soft); }
.tag.blue { color: var(--blue); background: var(--blue-soft); }
.tag.red { color: var(--red); background: var(--red-soft); }
.meta-text { color: var(--muted-light); font-size: 10px; }
.more-button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 7px; color: var(--muted-light); background: transparent; font-size: 18px; line-height: 1; }
.more-button:hover { color: var(--red); background: var(--red-soft); }
.empty-column { display: grid; min-height: 164px; place-items: center; padding: 28px; border: 1px dashed #d9dfdc; border-radius: 14px; color: var(--muted-light); text-align: center; }
.empty-column span { display: block; margin-bottom: 8px; font-size: 24px; }
.empty-column p { margin: 0; font-size: 12px; }

.jobs-heading { align-items: center; }
.upload-wrap { text-align: right; }
.job-data-actions { display: flex; justify-content: flex-end; gap: 9px; }
.job-data-actions a { color: inherit; text-decoration: none; }
.upload-wrap p { margin: 7px 0 0; color: var(--muted-light); font-size: 10px; }
.filter-panel { margin-bottom: 30px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.search-field { display: grid; grid-template-columns: 24px 1fr; align-items: center; margin-bottom: 15px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfa; }
.search-field > span { color: var(--muted-light); font-size: 19px; }
.search-field input { width: 100%; height: 44px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-field input::placeholder { color: #a2aaa6; }
.filter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.filter-row label > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 11px; }
.filter-row select { width: 100%; height: 40px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
.reset-button { height: 40px; padding: 0 7px; }
.result-heading { margin-bottom: 13px; }
.result-heading strong { color: var(--ink); }
.legend { display: flex; gap: 18px; color: var(--muted-light); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.hot-dot { width: 6px; height: 6px; border-radius: 50%; background: #d66d61; }

.jobs-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.jobs-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.jobs-table th { padding: 13px 15px; color: var(--muted); background: #f3f5f3; font-size: 10px; font-weight: 650; text-align: left; }
.jobs-table th:first-child { width: 27%; }
.jobs-table th:last-child { width: 104px; }
.jobs-table td { padding: 15px; border-top: 1px solid #edf0ee; color: var(--muted); font-size: 12px; vertical-align: middle; }
.job-company { display: flex; align-items: center; gap: 11px; }
.company-logo { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 800; }
.company-logo:nth-child(3n) { background: var(--blue-soft); }
.job-company strong, .job-company span { display: block; }
.job-company strong { overflow: hidden; margin-bottom: 2px; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.job-company span { color: var(--muted-light); font-size: 10px; }
.company-link { color: inherit; text-decoration: none; }
.company-link:hover strong { color: var(--green); }
.deadline-soon { color: var(--red) !important; font-weight: 650; }
.add-job-button { min-width: 72px; min-height: 34px; padding: 0 10px; border: 1px solid #cbd9d3; border-radius: 9px; color: var(--green); background: white; font-size: 11px; font-weight: 700; }
.add-job-button:hover { color: white; border-color: var(--green); background: var(--green); }
.add-job-button.is-added { color: var(--muted-light); border-color: var(--line); background: #f3f5f3; cursor: default; }
.empty-state { padding: 64px 24px; color: var(--muted); text-align: center; }
.empty-state > span { font-size: 34px; }
.empty-state h3 { margin: 8px 0 4px; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 0; font-size: 12px; }

dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 90px rgba(22, 33, 28, .23); }
dialog::backdrop { background: rgba(22, 30, 27, .42); backdrop-filter: blur(3px); }
.dialog-form { display: grid; gap: 15px; padding: 26px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 2px; }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.dialog-close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: var(--surface-soft); font-size: 20px; }
.dialog-form label { color: var(--muted); font-size: 11px; font-weight: 650; }
.dialog-form input, .dialog-form select, .dialog-form textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fbfcfb; font-weight: 400; }
.dialog-form textarea { resize: vertical; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; padding: 11px 16px; border-radius: 10px; color: white; background: #23332d; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
  .board-column { min-height: 0; }
  .filter-row { grid-template-columns: repeat(2, 1fr); }
  .jobs-table th:nth-child(2), .jobs-table td:nth-child(2), .jobs-table th:nth-child(5), .jobs-table td:nth-child(5) { display: none; }
  .jobs-table th:first-child { width: 34%; }
}

@media (max-width: 680px) {
  .app-shell { width: min(100% - 28px, 1240px); }
  .topbar { grid-template-columns: 1fr auto; min-height: 70px; }
  .main-nav { position: fixed; right: 14px; bottom: 14px; left: 14px; z-index: 40; justify-content: center; padding: 6px; box-shadow: 0 12px 34px rgba(25, 37, 31, .2); }
  .nav-item { flex: 1; }
  .nav-item, .icon-button, .add-job-button, .task-check, .more-button, .text-button, .dialog-close, .avatar { min-height: 40px; }
  .icon-button { width: 40px; height: 40px; }
  .task-check, .more-button, .dialog-close, .avatar { width: 40px; height: 40px; }
  .header-actions .save-state { display: none; }
  main { padding-top: 34px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading > .primary-button, .upload-wrap, .job-data-actions, .upload-wrap .secondary-button { width: 100%; }
  .job-data-actions { display: grid; grid-template-columns: 1fr; }
  .upload-wrap { text-align: center; }
  h1 { font-size: 30px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 102px; padding: 16px; }
  .stat-icon { display: none; }
  .focus-card { grid-column: 1 / -1; }
  .filter-row { grid-template-columns: 1fr; }
  .jobs-table { table-layout: auto; }
  .jobs-table thead { display: none; }
  .jobs-table tbody { display: grid; gap: 10px; padding: 10px; }
  .jobs-table tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
  .jobs-table td { padding: 0; border: 0; }
  .jobs-table td:first-child { grid-column: 1 / -1; }
  .jobs-table td:nth-child(2), .jobs-table td:nth-child(5) { display: none; }
  .jobs-table td:last-child { grid-column: 2; grid-row: 2 / span 3; align-self: end; }
  .legend { display: none; }
  .two-fields { grid-template-columns: 1fr; }
  .dialog-actions .primary-button, .dialog-actions .secondary-button { flex: 1; }
  body { padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
