:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #dfe5ea;
  --line-strong: #cfd7df;
  --ink: #17232f;
  --muted: #6d7a86;
  --muted-light: #9aa6b1;
  --accent: #2869c7;
  --accent-dark: #1c4f99;
  --accent-soft: #e8f0fd;
  --green: #16866a;
  --green-soft: #e2f4ed;
  --amber: #b66d17;
  --amber-soft: #fff2dc;
  --red: #c7504f;
  --red-soft: #fde9e8;
  --purple: #7764bd;
  --purple-soft: #efecfb;
  --shadow: 0 8px 30px rgba(24, 40, 56, .055);
  --radius: 6px;
  --sidebar: 244px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(40, 105, 199, .18); outline-offset: 1px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); display: flex; flex-direction: column; background: #1c2732; color: #f7fafc; padding: 24px 14px 16px; }
.brand-block { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; background: #e9f2ff; color: #1b5eab; border-radius: 6px; font-weight: 800; font-size: 17px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.brand-meta { margin-top: 1px; color: #94a7b8; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.primary-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #b9c7d2; padding: 10px 11px; text-align: left; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { background: #eaf1fb; color: #1a4f8e; }
.nav-icon { width: 18px; text-align: center; font-size: 16px; line-height: 1; }
.sidebar-section-label { margin: 33px 11px 10px; color: #7890a2; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.workspace-switcher { display: flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 5px; padding: 10px; background: rgba(255,255,255,.045); }
.workspace-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 5px; background: #d8eef0; color: #176d73; font-weight: 800; }
.workspace-copy { min-width: 0; flex: 1; display: grid; }
.workspace-copy strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-copy span { color: #879cac; font-size: 10px; margin-top: 2px; }
.sidebar-footer { margin-top: auto; padding: 17px 10px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.sync-status { display: flex; align-items: center; gap: 6px; color: #91a5b4; font-size: 10px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-light); }
.status-dot.online { background: #4cc28c; box-shadow: 0 0 0 3px rgba(76,194,140,.11); }
.status-dot.connecting { background: var(--amber); box-shadow: 0 0 0 3px rgba(182,109,23,.1); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 3px rgba(199,80,79,.1); }

.main-content { min-width: 0; flex: 1; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 42px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.eyebrow, .panel-kicker, .section-kicker { color: var(--muted); font-size: 10px; letter-spacing: .13em; font-weight: 700; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 3px; font-size: 22px; letter-spacing: -.025em; }
h2 { margin-top: 4px; font-size: 26px; letter-spacing: -.035em; }
h3 { margin-top: 4px; font-size: 16px; letter-spacing: -.01em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.collab-status { display: flex; align-items: center; gap: 7px; min-width: 132px; padding-right: 10px; border-right: 1px solid var(--line); }
.presence-stack { display: flex; align-items: center; min-width: 28px; }
.presence-avatar { width: 25px; height: 25px; display: grid; place-items: center; margin-left: -6px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 9px; font-weight: 800; }
.presence-avatar:first-child { margin-left: 0; }
.presence-avatar:nth-child(2) { background: var(--green-soft); color: var(--green); }
.presence-avatar:nth-child(3) { background: var(--amber-soft); color: var(--amber); }
.presence-avatar.more { background: #edf1f4; color: var(--muted); }
.identity-button { min-width: 0; display: grid; gap: 1px; border: 0; background: transparent; padding: 2px 3px; color: var(--ink); text-align: left; }
.identity-button strong { font-size: 10px; white-space: nowrap; }
.identity-button span { max-width: 72px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.identity-button:hover span { color: var(--accent-dark); }
.month-picker { display: flex; align-items: center; gap: 8px; padding-right: 5px; color: var(--muted); font-size: 11px; }
select, input, textarea { color: var(--ink); }
.month-picker select, .filter-bar select, .schedule-list-panel select { border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; padding: 4px 18px 4px 0; font-weight: 700; color: var(--ink); }

.content-wrap { max-width: 1540px; margin: 0 auto; padding: 32px 42px 50px; }
.view-panel { display: none; }
.view-panel.active { display: block; }
.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.section-intro.compact { margin-bottom: 22px; }
.section-description { margin-top: 8px; max-width: 620px; color: var(--muted); }
.intro-actions { display: flex; align-items: center; gap: 9px; }
.primary-button, .secondary-button, .ghost-button, .text-button, .icon-button, .danger-button { border: 0; border-radius: 5px; transition: .18s ease; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; padding: 9px 13px; box-shadow: 0 2px 0 rgba(0,0,0,.04); }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); padding: 8px 12px; }
.secondary-button:hover { border-color: var(--accent); color: var(--accent-dark); background: #fbfdff; }
.danger-button { margin-right: auto; padding: 8px 10px; background: transparent; color: var(--red); }
.danger-button:hover { background: var(--red-soft); }
.ghost-button { padding: 8px 10px; background: transparent; color: var(--accent-dark); }
.ghost-button:hover, .text-button:hover { color: var(--accent); background: var(--accent-soft); }
.text-button { padding: 5px 7px; background: transparent; color: var(--accent-dark); font-size: 12px; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.icon-button.small { width: 24px; height: 24px; color: #91a5b4; }
.mobile-menu { display: none; }
.button-symbol { font-size: 18px; line-height: .7; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; background: var(--surface); }
.kpi-card { min-height: 126px; padding: 18px 20px; border-right: 1px solid var(--line); }
.kpi-card:last-child { border-right: 0; }
.kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.kpi-value { display: flex; align-items: baseline; gap: 7px; margin-top: 15px; }
.kpi-value strong { font-size: 30px; letter-spacing: -.045em; }
.kpi-value span { color: var(--muted); font-size: 12px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 13px; color: var(--muted); font-size: 11px; }
.kpi-accent { color: var(--accent); }
.kpi-green { color: var(--green); }
.kpi-amber { color: var(--amber); }
.kpi-red { color: var(--red); }
.mini-bar { width: 66px; height: 5px; overflow: hidden; border-radius: 3px; background: #e8edf1; }
.mini-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.dashboard-grid.lower { grid-template-columns: 1.1fr .9fr; margin-top: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.panel-header > div:first-child { min-width: 0; }
.trend-badge, .status-badge, .risk-pill, .stage-pill, .priority-pill { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; border-radius: 99px; font-size: 10px; font-weight: 700; }
.trend-badge { padding: 4px 8px; }
.trend-badge.positive { color: var(--green); background: var(--green-soft); }
.trend-badge.warning { color: var(--amber); background: var(--amber-soft); }
.trend-badge.negative { color: var(--red); background: var(--red-soft); }
.pace-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; padding: 10px 20px 18px; }
.pace-number { display: flex; align-items: baseline; gap: 5px; }
.pace-number strong { font-size: 42px; line-height: 1; letter-spacing: -.06em; }
.pace-number span { color: var(--muted); font-size: 13px; }
.pace-meta { max-width: 170px; color: var(--muted); font-size: 11px; text-align: right; }
.progress-track { height: 8px; overflow: hidden; border-radius: 6px; background: #e9eef2; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.progress-track.large { margin: 0 20px; }
.pace-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px 0; color: var(--muted); font-size: 11px; }
.pace-foot strong { color: var(--ink); }
.pace-chart { display: flex; align-items: flex-end; gap: 10px; height: 112px; padding: 22px 20px 17px; border-top: 1px solid var(--line); margin-top: 18px; background: var(--surface-soft); }
.chart-empty { width: 100%; align-self: center; color: var(--muted-light); font-size: 11px; text-align: center; }
.chart-bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.chart-bar { width: 100%; max-width: 30px; min-height: 4px; border-radius: 3px 3px 1px 1px; background: #a9c6ea; transition: height .3s ease; }
.chart-bar.today { background: var(--accent); }
.chart-label { color: var(--muted-light); font-size: 9px; }
.alert-panel { min-height: 300px; }
.alert-list { padding: 0 20px 12px; }
.alert-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.alert-item:first-child { border-top: 0; }
.alert-mark { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.alert-mark.red { background: var(--red); }
.alert-mark.green { background: var(--green); }
.alert-title { font-weight: 700; font-size: 12px; }
.alert-detail { margin-top: 3px; color: var(--muted); font-size: 11px; }
.alert-date { color: var(--muted); font-size: 10px; white-space: nowrap; }

.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.data-table th { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-soft); }
.data-table tbody tr { transition: background .16s ease; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table td:first-child { font-weight: 700; }
.group-cell { display: flex; align-items: center; gap: 8px; }
.group-avatar { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 4px; background: var(--accent-soft); color: var(--accent-dark); font-size: 11px; font-weight: 800; }
.load-cell { min-width: 115px; }
.load-bar { display: flex; align-items: center; gap: 8px; }
.load-track { width: 70px; height: 5px; overflow: hidden; border-radius: 4px; background: #e9eef2; }
.load-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.load-track span.warn { background: var(--amber); }
.load-track span.danger { background: var(--red); }
.muted-text { color: var(--muted); font-size: 11px; }
.status-badge { padding: 4px 7px; }
.status-badge.normal { color: var(--green); background: var(--green-soft); }
.status-badge.watch { color: var(--amber); background: var(--amber-soft); }
.status-badge.danger { color: var(--red); background: var(--red-soft); }
.status-badge.done { color: var(--accent-dark); background: var(--accent-soft); }
.delivery-list { padding: 0 20px 16px; }
.delivery-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.delivery-row:first-child { border-top: 0; }
.date-block { display: grid; place-items: center; padding: 4px 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-soft); }
.date-block strong { font-size: 16px; line-height: 1.1; }
.date-block span { color: var(--muted); font-size: 9px; }
.delivery-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.delivery-meta { margin-top: 2px; color: var(--muted); font-size: 10px; }
.delivery-progress { color: var(--muted); font-size: 10px; }
.activity-panel { margin-top: 18px; }
.live-label { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; }
.activity-list { padding: 0 20px; }
.activity-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.activity-avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 10px; font-weight: 800; }
.activity-text { font-size: 12px; }
.activity-text strong { font-weight: 700; }
.activity-time { color: var(--muted-light); font-size: 10px; white-space: nowrap; }

.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 15px; }
.search-field { min-width: 235px; flex: 1; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); padding: 7px 10px; }
.search-field span { color: var(--muted); font-size: 18px; line-height: 1; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.filter-bar select { border: 1px solid var(--line-strong); border-radius: 5px; padding: 7px 27px 7px 10px; background: var(--surface); font-size: 12px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.bulk-toolbar { display: flex; align-items: center; gap: 9px; min-height: 42px; margin: -3px 0 12px; padding: 7px 10px; border: 1px solid #c7d8ee; border-radius: 5px; background: var(--accent-soft); color: var(--accent-dark); font-size: 11px; }
.bulk-toolbar select { border: 1px solid #b9cce6; border-radius: 4px; padding: 6px 25px 6px 8px; background: #fff; color: var(--ink); font-size: 11px; }
.bulk-toolbar .secondary-button { padding: 6px 9px; border-color: #b9cce6; font-size: 11px; }
.selection-cell { width: 34px; padding-right: 5px !important; }
.selection-cell input { width: 15px; height: 15px; accent-color: var(--accent); }
.project-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.project-table .project-title { display: flex; align-items: center; gap: 9px; }
.project-code { color: var(--muted); font-size: 10px; font-weight: 500; }
.project-table .progress-cell { min-width: 135px; }
.progress-inline { display: flex; align-items: center; gap: 8px; }
.progress-inline .progress-track { width: 86px; height: 6px; }
.progress-inline span { color: var(--muted); font-size: 10px; }
.stage-pill { padding: 4px 8px; color: #50616e; background: #eef2f5; }
.stage-pill.finished { color: var(--purple); background: var(--purple-soft); }
.stage-pill.done { color: var(--green); background: var(--green-soft); }
.priority-pill { padding: 4px 7px; }
.priority-pill.high { color: var(--red); background: var(--red-soft); }
.priority-pill.medium { color: var(--amber); background: var(--amber-soft); }
.priority-pill.low { color: var(--muted); background: #eef2f5; }
.row-actions { display: flex; align-items: center; gap: 3px; }
.row-actions .icon-button { width: 27px; height: 27px; font-size: 15px; }
.empty-state { padding: 65px 25px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 5px; }
.empty-state span { display: block; font-size: 12px; }
.empty-workspace { display: grid; justify-items: center; gap: 8px; min-height: 300px; align-content: center; }
.empty-workspace .empty-icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 23px; }
.empty-workspace .primary-button { margin-top: 8px; }
.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); }
.segment { border: 0; border-radius: 3px; padding: 5px 10px; background: transparent; color: var(--muted); font-size: 12px; }
.segment.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.hidden { display: none !important; }

.kanban-wrap { display: grid; grid-template-columns: repeat(7, minmax(220px, 1fr)); gap: 11px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { min-height: 410px; border: 1px solid var(--line); border-radius: var(--radius); background: #edf1f4; }
.kanban-column-header { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.kanban-column-header strong { font-size: 12px; }
.kanban-count { min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 10px; }
.kanban-cards { display: grid; gap: 8px; padding: 9px; }
.kanban-card { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 11px; box-shadow: 0 3px 9px rgba(24,40,56,.04); cursor: pointer; }
.kanban-card:hover { border-color: #a7bfdf; }
.kanban-card-title { font-size: 12px; font-weight: 700; }
.kanban-card-meta { display: flex; justify-content: space-between; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.kanban-card .progress-track { margin-top: 10px; height: 5px; }

.schedule-summary, .team-summary { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 11px; }
.summary-stat strong { display: block; color: var(--ink); font-size: 19px; line-height: 1.1; }
.summary-stat span { display: block; margin-top: 3px; }
.schedule-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 18px; }
.calendar-panel, .schedule-list-panel { min-height: 520px; }
.calendar-nav { display: flex; align-items: center; gap: 2px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { padding: 11px 18px 7px; color: var(--muted-light); font-size: 10px; text-align: center; }
.calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin: 0 18px 18px; }
.calendar-cell { min-height: 77px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.calendar-cell.muted { background: var(--surface-soft); color: var(--muted-light); }
.calendar-cell.today { background: #f3f8ff; }
.calendar-day { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.calendar-cell.today .calendar-day strong { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; }
.calendar-events { display: grid; gap: 3px; margin-top: 7px; }
.calendar-event { overflow: hidden; padding: 3px 4px; border-left: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.calendar-event.watch { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.calendar-event.danger { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.schedule-list { padding: 0 20px 15px; }
.schedule-item { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.schedule-item:first-child { border-top: 0; }
.schedule-date strong { display: block; font-size: 17px; line-height: 1.1; }
.schedule-date span { color: var(--muted); font-size: 10px; }
.schedule-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 12px; }
.schedule-meta { margin-top: 3px; color: var(--muted); font-size: 10px; }

.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.team-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 17px; }
.team-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.team-card-name { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.team-card-name .group-avatar { width: 29px; height: 29px; }
.team-card-members { margin-top: 12px; color: var(--muted); font-size: 11px; }
.team-card-load { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; }
.team-card-load strong { font-size: 25px; letter-spacing: -.04em; }
.team-card-load span { color: var(--muted); font-size: 11px; }
.team-card .load-track { width: 100%; height: 7px; margin-top: 10px; }
.team-card-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.team-detail-panel { margin-top: 18px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 27, 39, .45); }
.modal-backdrop.open { display: flex; }
.modal { width: min(650px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 25px 75px rgba(13,24,35,.22); }
.small-modal { width: min(540px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 20px; }
.editing-notice { display: flex; align-items: center; gap: 8px; margin: 14px 22px 0; padding: 9px 10px; border: 1px solid #badfd2; border-radius: 5px; background: var(--green-soft); color: #11664f; font-size: 11px; }
.project-form { padding: 19px 22px 22px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field { display: grid; gap: 6px; margin-bottom: 13px; color: var(--muted); font-size: 11px; font-weight: 700; }
.form-field output { float: right; color: var(--accent); font-weight: 800; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 4px; outline: 0; background: var(--surface); padding: 8px 9px; color: var(--ink); font-size: 13px; font-weight: 400; }
.form-field textarea { resize: vertical; }
.form-field input[type="range"] { padding: 5px 0; border: 0; accent-color: var(--accent); }
.form-help { color: var(--muted); font-size: 11px; margin: -1px 0 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 9px; }
.toast-region { position: fixed; z-index: 40; right: 22px; bottom: 22px; display: grid; gap: 8px; width: min(340px, calc(100vw - 44px)); }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 5px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font-size: 12px; animation: toast-in .2s ease; }
.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--amber); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1180px) {
  :root { --sidebar: 215px; }
  .topbar, .content-wrap { padding-left: 26px; padding-right: 26px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .collab-status { min-width: auto; }
  .identity-button span { display: none; }
}
@media (max-width: 920px) {
  .sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 12px 0 35px rgba(12,25,36,.14); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; }
  .topbar { padding: 15px 20px; }
  .content-wrap { padding: 24px 20px 40px; }
  .dashboard-grid, .dashboard-grid.lower, .schedule-layout { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi-card:nth-child(2) { border-right: 0; }
  .kpi-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 13px; }
  .topbar-actions { width: calc(100% - 40px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; }
  .topbar-actions .secondary-button, .topbar-actions .primary-button { width: 100%; min-width: 0; }
  .collab-status { grid-column: 1 / -1; grid-row: 1; width: 100%; padding: 7px 0 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .identity-button { display: flex; align-items: center; gap: 6px; }
  .identity-button span { display: inline; max-width: 120px; }
  .month-picker { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: space-between; padding-right: 0; }
  h1 { font-size: 20px; }
  h2 { font-size: 23px; }
  .section-intro { align-items: flex-start; flex-direction: column; gap: 16px; }
  .intro-actions { width: calc(100% - 40px); flex-wrap: wrap; }
  .intro-actions > * { min-width: 0; flex: 1; text-align: center; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 106px; border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi-card:last-child { border-bottom: 0; }
  .pace-foot { flex-direction: column; gap: 5px; }
  .form-grid.two { grid-template-columns: 1fr; gap: 0; }
  .schedule-summary, .team-summary { width: 100%; justify-content: space-between; gap: 8px; }
  .team-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; }
  .search-field { flex-basis: 100%; }
  .filter-bar select { flex: 1; min-width: 0; }
  .result-count { width: 100%; margin-left: 0; }
  .bulk-toolbar { align-items: stretch; flex-wrap: wrap; }
  .bulk-toolbar > span { width: 100%; }
  .bulk-toolbar select, .bulk-toolbar .secondary-button { flex: 1; min-width: 0; }
  .calendar-cell { min-height: 60px; padding: 5px; }
  .calendar-event { font-size: 8px; }
}
