:root {
  --navy: #06172e;
  --navy-2: #0a2344;
  --blue: #0868f7;
  --blue-soft: #eaf2ff;
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #142033;
  --muted: #667085;
  --line: #dce3ec;
  --line-strong: #c8d2df;
  --amber: #ef8a00;
  --amber-soft: #fff4e5;
  --green: #169b62;
  --red: #c73838;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 31, 54, .04), 0 10px 35px rgba(13, 31, 54, .04);
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(8, 104, 247, .28); outline-offset: 2px; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 99; background: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; background: linear-gradient(180deg, #051a35, var(--navy)); color: #dbe8f8; display: flex; flex-direction: column; overflow: hidden; }
.sidebar::after { content: ""; position: absolute; inset: auto -80px -100px auto; width: 240px; height: 240px; border: 1px solid rgba(62, 151, 255, .16); transform: rotate(35deg); background: repeating-linear-gradient(0deg, transparent 0 12px, rgba(48, 132, 255, .035) 12px 13px); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 8px; position: relative; z-index: 1; }
.brand-mark { width: 34px; height: 34px; position: relative; display: grid; place-items: center; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--blue); border-radius: 5px 2px 5px 2px; box-shadow: 0 0 20px rgba(8, 104, 247, .38); }
.brand-mark::before { width: 30px; height: 10px; top: 3px; left: 2px; }
.brand-mark::after { width: 11px; height: 29px; top: 3px; left: 12px; transform: skewY(-25deg); }
.brand strong { color: white; font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.brand small { display: block; margin-top: 1px; color: #7e9abc; font-size: 11px; }
.nav { margin-top: 30px; display: grid; gap: 7px; position: relative; z-index: 1; }
.nav-link { border: 0; background: transparent; color: #c7d4e4; width: 100%; min-height: 50px; padding: 0 14px; border-radius: 8px; display: flex; align-items: center; gap: 13px; text-decoration: none; text-align: left; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-link.active { color: #56a1ff; background: linear-gradient(90deg, rgba(7, 103, 247, .22), rgba(7, 103, 247, .08)); box-shadow: inset 3px 0 var(--blue); }
.nav-link svg { width: 22px; height: 22px; flex: none; }
.nav-label { font-size: 15px; }
.sidebar-bottom { margin-top: auto; position: relative; z-index: 1; }

.workspace { min-width: 0; }
.topbar { height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 30px; background: rgba(255,255,255,.9); border-bottom: 1px solid rgba(220,227,236,.9); position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(140%) blur(10px); }
.greeting h1 { font-size: 22px; line-height: 1.2; margin: 0; letter-spacing: -.02em; }
.greeting p { margin: 5px 0 0; color: var(--muted); }
.account { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; color: #0b315d; font-weight: 750; background: linear-gradient(145deg, #cfe0f2, #eff5fb); border: 1px solid #cbd8e6; }
.account-copy { display: grid; line-height: 1.25; }
.account-copy small { color: var(--muted); }
.icon-btn { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: white; display: grid; place-items: center; color: var(--muted); }

.main { padding: 20px 30px 36px; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 18px; }
.page-head h2 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.week-control { display: flex; align-items: center; gap: 8px; }
.week-control input { height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: white; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, 1fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { min-height: 58px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.card-header h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.card-header span, .muted { color: var(--muted); }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.priority-list { position: relative; }
.priority-list::before { content: ""; position: absolute; left: 32px; top: 0; bottom: 0; width: 1px; background: #cdd7e4; }
.priority-row { display: grid; grid-template-columns: 112px minmax(180px, 1fr) 145px 110px 100px; align-items: center; min-height: 68px; padding: 0 18px 0 0; border-bottom: 1px solid var(--line); position: relative; }
.priority-row:last-child { border-bottom: 0; }
.priority-index { color: var(--blue); font-size: 13px; font-weight: 750; letter-spacing: .03em; padding-left: 48px; position: relative; white-space: nowrap; }
.priority-index::before { content: ""; position: absolute; width: 9px; height: 9px; border: 2px solid var(--blue); background: white; border-radius: 50%; left: 27px; top: 6px; }
.member { display: flex; align-items: center; gap: 9px; min-width: 0; }
.member .avatar { width: 32px; height: 32px; font-size: 12px; }
.member-meta { min-width: 0; }
.member-meta strong, .member-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-meta small { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 7px; color: #465368; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.status.blocked, .status.review { color: #a45a00; }
.status.blocked::before, .status.review::before { background: var(--amber); }
.status.done::before { background: var(--green); }

.task-list { display: grid; }
.task-check { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; min-height: 53px; border-bottom: 1px solid var(--line); }
.task-check:last-child { border-bottom: 0; }
.task-check input { width: 17px; height: 17px; accent-color: var(--blue); }
.tag { color: var(--blue); background: var(--blue-soft); padding: 3px 7px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.button { min-height: 40px; padding: 0 16px; border-radius: 7px; border: 1px solid transparent; background: white; color: var(--ink); font-weight: 650; }
.button.primary { background: var(--blue); color: white; box-shadow: 0 5px 16px rgba(8,104,247,.16); }
.button.secondary { border-color: #aac9f7; color: var(--blue); }
.button.ghost { color: var(--blue); padding-inline: 8px; }
.button.danger { color: var(--red); border-color: #f2caca; }
.button.full { width: 100%; }
.mt-16 { margin-top: 16px; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.help-list { display: grid; }
.help-row { min-height: 74px; padding: 12px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.help-row:last-child { border: 0; }
.help-copy strong, .help-copy small { display: block; }
.help-copy small { color: var(--muted); margin-top: 2px; }
.decision { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: #344054; }
.meeting-spotlight { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: start; }
.meeting-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--blue-soft); display: grid; place-items: center; color: var(--blue); }
.meeting-icon svg { width: 28px; }
.meeting-copy h4 { font-size: 16px; margin: 0 0 4px; }
.meeting-copy p { color: var(--muted); margin: 2px 0; }
.text-link { border: 0; padding: 0; background: transparent; color: var(--blue); text-decoration: none; }
.deadline-list { display: grid; }
.deadline-row { min-height: 54px; display: grid; grid-template-columns: 1fr 130px 105px; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.deadline-row:last-child { border: 0; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { color: var(--muted); font-size: 12px; font-weight: 550; text-align: left; background: var(--surface-2); }
.data-table th, .data-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fbfcfe; }
.truncate { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: white; border-radius: 7px; min-height: 36px; padding: 0 12px; color: var(--muted); }
.filter.active { color: var(--blue); border-color: #9ec2f8; background: var(--blue-soft); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project-card { padding: 18px; min-height: 190px; display: flex; flex-direction: column; }
.project-key { font: 700 12px var(--mono); color: var(--blue); letter-spacing: .08em; }
.project-card h3 { margin: 8px 0 6px; font-size: 17px; }
.project-card p { margin: 0; color: var(--muted); }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 20px; }
.project-card .meter { height: 4px; background: #e9eef5; border-radius: 99px; overflow: hidden; margin-top: 18px; }
.project-card .meter span { display: block; height: 100%; background: var(--blue); }
.meter .p-0 { width: 0%; }.meter .p-10 { width: 10%; }.meter .p-20 { width: 20%; }.meter .p-30 { width: 30%; }.meter .p-40 { width: 40%; }.meter .p-50 { width: 50%; }.meter .p-60 { width: 60%; }.meter .p-70 { width: 70%; }.meter .p-80 { width: 80%; }.meter .p-90 { width: 90%; }.meter .p-100 { width: 100%; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 14px; }
.timeline { position: relative; margin-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px; background: var(--line-strong); }
.timeline-item { position: relative; padding: 0 0 19px 28px; }
.timeline-item::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border: 2px solid var(--blue); border-radius: 50%; background: white; }
.timeline-item h4 { margin: 0 0 4px; }
.timeline-item p { margin: 0; color: var(--muted); }
.timeline-item time { color: #98a2b3; font-size: 12px; }

.empty { min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0 0 14px; }
.skeleton { height: 13px; border-radius: 4px; background: linear-gradient(90deg,#edf1f5,#f7f9fb,#edf1f5); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(3, 14, 29, .56); display: grid; place-items: center; padding: 18px; }
.modal { width: min(620px, 100%); max-height: min(820px, 92vh); overflow: auto; background: white; border-radius: 14px; box-shadow: 0 26px 80px rgba(0,0,0,.25); }
.modal-header { padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.form { display: grid; gap: 15px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; color: #344054; }
.field input, .field textarea, .field select { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px 11px; background: white; color: var(--ink); }
.field textarea { min-height: 90px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr); background: var(--navy); }
.login-brand { padding: clamp(36px, 7vw, 90px); color: white; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 520px; height: 520px; right: -260px; bottom: -250px; border: 1px solid rgba(61,147,255,.25); transform: rotate(35deg); background: repeating-linear-gradient(0deg, transparent 0 18px, rgba(61,147,255,.04) 18px 19px); }
.login-brand .brand { padding: 0; }
.login-statement { max-width: 560px; position: relative; z-index: 1; }
.login-statement .eyebrow { color: #6fb0ff; font: 700 12px var(--mono); letter-spacing: .12em; }
.login-statement h1 { margin: 14px 0; font-size: clamp(34px, 5vw, 62px); line-height: 1.08; letter-spacing: -.04em; }
.login-statement p { color: #9fb4ce; max-width: 32em; font-size: 16px; }
.login-panel { background: #f7f9fc; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(440px, 100%); }
.login-card h2 { margin: 0; font-size: 26px; }
.login-card > p { color: var(--muted); margin: 7px 0 26px; }
.login-card .form { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); }
.login-error { color: var(--red); background: #fff1f1; border: 1px solid #f6c7c7; padding: 10px 12px; border-radius: 7px; display: none; }
.login-error.visible { display: block; }
.setup-link { justify-self: center; margin-top: 2px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 8px; color: white; background: #17283e; box-shadow: 0 12px 40px rgba(0,0,0,.2); animation: toast-in .2s ease both; }
.toast.error { background: #9d2e2e; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 1120px) {
  .dashboard-grid, .panel-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .priority-row { grid-template-columns: 108px minmax(180px,1fr) 135px 95px; }
  .priority-row > :nth-child(4) { display: none; }
}
@media (max-width: 820px) {
  .app-shell { display: block; padding-bottom: 68px; }
  .sidebar { position: fixed; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 68px; padding: 7px 8px; flex-direction: row; }
  .sidebar::after, .sidebar .brand, .sidebar-bottom { display: none; }
  .nav { margin: 0; width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .nav-link { min-height: 54px; padding: 5px; flex-direction: column; justify-content: center; gap: 2px; border-radius: 7px; }
  .nav-link.active { box-shadow: inset 0 3px var(--blue); }
  .nav-link svg { width: 19px; height: 19px; }
  .nav-label { font-size: 11px; }
  .topbar { height: auto; min-height: 72px; grid-template-columns: 1fr auto; padding: 12px 16px; }
  .account-copy { display: none; }
  .main { padding: 16px; }
  .project-grid { grid-template-columns: 1fr; }
  .priority-row { grid-template-columns: 98px minmax(0,1fr) 90px; padding-right: 12px; }
  .priority-row > :nth-child(3), .priority-row > :nth-child(4) { display: none; }
  .priority-index { padding-left: 42px; font-size: 12px; }
  .priority-index::before { left: 27px; }
  .data-table { min-width: 760px; }
  .table-scroll { overflow-x: auto; }
  .form-row { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; background: #f7f9fc; }
  .login-brand { min-height: 250px; padding: 32px 24px; }
  .login-statement h1 { font-size: 34px; }
  .login-panel { padding: 24px 16px 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
