/* PrimaLux visual system v1
   One UI font stack, a 4/8 spacing rhythm, readable type, and restrained surfaces.
   The task table keeps its established product-specific sizing; this file focuses
   on the surrounding navigation, smart views, calendars, drawers, and dialogs. */
:root {
  --font-ui: 'Noto Sans SC', 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ds-bg: #f5f7fb;
  --ds-surface: #ffffff;
  --ds-surface-subtle: #f8f9fc;
  --ds-ink: #1d2a42;
  --ds-text: #3e4c64;
  --ds-muted: #68768d;
  --ds-subtle: #8b97aa;
  --ds-line: #dfe5ee;
  --ds-line-soft: #ebeff5;
  --ds-primary: #6556d4;
  --ds-primary-soft: #efedff;
  --ds-success: #18a77e;
  --ds-warning: #e6953f;
  --ds-danger: #d85a68;
  --ds-radius-sm: 7px;
  --ds-radius-md: 10px;
  --ds-radius-lg: 14px;
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-7: 32px;
}

html { font-size: 16px; }
body { font-family: var(--font-ui); font-size: 15px; line-height: 1.5; color: var(--ds-ink); background: var(--ds-bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font-family: var(--font-ui); }
.side-rail { width: 78px; background: #202844; box-shadow: 2px 0 12px rgba(31, 40, 69, .12); }
.rail-brand { font-size: 11px; }
.rail-link { font-size: 13px; gap: 6px; padding: 11px 2px 9px; }
.rail-icon { font-size: 22px; }
.workspace-sidebar { width: 248px; padding: 22px 15px 16px; background: #fbfcfe; }
.workspace-title, .workspace-switcher { font-size: 15px; }
.workspace-head { margin-bottom: 16px; }
.workspace-switcher { height: 44px; }
.sidebar-section { margin-top: 24px; }
.section-label { padding: 0 8px 8px; font-size: 12px; color: var(--ds-muted); letter-spacing: .04em; }
.project-item, .sidebar-link { min-height: 40px; padding: 9px 10px; font-size: 14px; }
.project-count, .link-count { font-size: 13px; }
.sidebar-footer { padding-top: 14px; font-size: 12px; }
.main-content { padding: 0 28px 40px; max-width: 1680px; }
.topbar { height: 64px; }
.breadcrumbs { gap: 9px; font-size: 14px; }
.status-pill { padding: 6px 10px; font-size: 12px; }
.top-actions { gap: 13px; }
.account-label { font-size: 14px; }
.project-heading { padding: 26px 0 20px; }
.project-heading h1 { margin-bottom: 6px; font-size: 28px; }
.project-heading p { font-size: 14px; }
.eyebrow { margin-bottom: 7px; font-size: 12px; }
.heading-actions { gap: 8px; }
.heading-actions .secondary-btn, .heading-actions .primary-btn { padding: 9px 13px; font-size: 14px; }
.insight-grid { gap: 12px; margin-bottom: 18px; }
.insight-card { min-height: 96px; padding: 15px 17px; border-radius: var(--ds-radius-md); }
.insight-label { margin-bottom: 6px; font-size: 13px; color: var(--ds-muted); }
.insight-value { font-size: 27px; }
.insight-meta { margin-top: 5px; font-size: 12px; }
.alternate-view { min-height: 0; background: var(--ds-surface); }

/* Secondary views */
.timeline-view, .activity-view, .kanban-view, .smart-list-view, .gantt-view, .flat-calendar { font-size: 15px; }
.timeline-toolbar, .activity-head { padding: 16px 20px; }
.timeline-toolbar strong, .activity-head strong { font-size: 16px; }
.timeline-toolbar span, .activity-head span { font-size: 13px; }
.timeline-legend { gap: 14px; font-size: 12px !important; }
.timeline-header { height: 46px; }
.timeline-task-head { padding: 0 20px; font-size: 12px; }
.timeline-row { min-height: 58px; }
.timeline-task { padding: 0 20px; font-size: 14px; }
.timeline-bar { height: 30px; font-size: 12px; }
.timeline-day { font-size: 12px; }
.timeline-day small { font-size: 11px; }
.timeline-empty { padding: 44px 20px; font-size: 14px; }
.kanban-view { gap: 14px; padding: 18px; }
.kanban-column { padding: 14px; border-radius: var(--ds-radius-md); }
.kanban-column-head { font-size: 15px; }
.kanban-column-head b { font-size: 13px; }
.kanban-card { padding: 15px; border-radius: var(--ds-radius-md); }
.kanban-card h3 { margin: 9px 0 5px; font-size: 15px; }
.kanban-card p { font-size: 13px; line-height: 1.55; }
.kanban-card-foot { margin-top: 11px; font-size: 12px; }
.kanban-card .priority { font-size: 12px; }
.kanban-empty { padding: 25px 6px; font-size: 13px; }
.activity-list { padding: 4px 20px 22px; }
.activity-item { gap: 12px; padding: 15px 0; }
.activity-item strong { font-size: 15px; }
.activity-item p { margin: 4px 0; font-size: 14px; line-height: 1.6; }
.activity-item small { font-size: 12px; }
.smart-list-view { padding: 20px 22px 24px; }
.smart-list-head { gap: 16px; padding-bottom: 15px; }
.smart-list-head h2 { margin-bottom: 5px; font-size: 26px; }
.smart-list-head p { font-size: 14px; line-height: 1.55; }
.smart-list-count { padding: 7px 10px; font-size: 13px; }
.smart-list-columns { padding: 11px 14px; font-size: 12px; }
.smart-task-row { padding: 14px; gap: 12px; }
.smart-task-main { gap: 3px; }
.smart-task-main strong { font-size: 15px; }
.smart-task-main small { font-size: 13px; }
.smart-task-project, .smart-task-due { font-size: 13px; }
.smart-task-label { padding: 5px 8px; font-size: 12px; }
.smart-empty { padding: 52px 20px; font-size: 14px; }
.smart-empty strong { font-size: 15px; }

/* Drawers and dialogs */
.notification-drawer { width: 400px; padding: 24px 22px; }
.drawer-head h2 { font-size: 25px; }
.drawer-tabs { margin-top: 20px; }
.drawer-tab { padding: 10px 0; font-size: 14px; }
.notification-item { gap: 12px; padding: 15px 2px; }
.notification-title { font-size: 15px; }
.notification-body { font-size: 14px; line-height: 1.6; }
.notification-time { font-size: 12px; }
.feishu-status-card { padding: 12px; margin: 12px 0; }
.feishu-status-card strong { font-size: 14px; }
.feishu-status-card small, .feishu-status-card button { font-size: 13px; }
.mark-read { padding-top: 14px; font-size: 14px; }
.task-detail-drawer { width: 470px; padding: 25px 24px; }
.task-detail-drawer h2 { font-size: 24px; }
.detail-form label { margin-bottom: 14px; font-size: 14px; }
.detail-form input, .detail-form select, .detail-form textarea { padding: 10px 11px; font-size: 15px; }
.detail-section-title { font-size: 14px; }
.downstream-item { font-size: 14px; }
.detail-footer button, .watch-task-btn, .danger-btn { font-size: 14px; }
.modal-backdrop { padding: 18px; }
.task-modal, .project-modal, .project-members-modal { padding: 24px; border-radius: var(--ds-radius-lg); }
.modal-head { margin-bottom: 19px; }
.modal-head h2 { font-size: 25px; }
.task-modal label, .project-modal label, .project-member-form label { margin-bottom: 14px; font-size: 14px; }
.task-modal input, .task-modal select, .task-modal textarea, .project-modal input, .project-modal select, .project-modal textarea { padding: 10px 11px; font-size: 15px; }
.modal-note, .project-modal-foot > span { font-size: 13px; }
.project-modal-intro, .project-members-intro { font-size: 14px; }
.project-members-modal { width: min(650px, 100%); }
.project-members-section-title { font-size: 14px; }
.project-member-identity strong { font-size: 14px; }
.project-member-identity small, .project-member-role { font-size: 12px; }
.project-member-role-select {
  flex: 0 0 136px;
  min-height: 34px;
  margin-left: auto;
  padding: 6px 30px 6px 10px;
  border: 1px solid #dfe4ed;
  border-radius: 8px;
  background-color: #fbfcfe;
  color: #4c5a70;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.project-member-role-select:hover { border-color: #b9b0ef; background-color: #f8f6ff; }
.project-member-role-select:disabled { cursor: wait; opacity: .6; }
.project-member-picker-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.project-member-picker-field legend { width: 100%; margin: 0 0 7px; padding: 0; color: #68758a; font-size: 14px; font-weight: 600; }
.project-member-picker-field legend span { margin-left: 5px; color: #929dad; font-size: 12px; font-weight: 500; }
.project-member-candidate-list { max-height: 184px; overflow-y: auto; padding: 5px; border: 1px solid #dfe4ed; border-radius: 9px; background: #fbfcfe; scrollbar-width: thin; }
.project-member-candidate {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0 !important;
  padding: 5px 7px;
  border-radius: 7px;
  color: #4b5870;
  cursor: pointer;
}
.project-member-candidate:hover { background: #f2efff; }
.project-member-candidate input { width: 16px; height: 16px; margin: 0; accent-color: #6656d6; flex: 0 0 16px; }
.project-member-candidate .user-avatar { width: 27px; height: 27px; border: 0; font-size: 9px; flex: 0 0 27px; }
.project-member-candidate-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.project-member-candidate-copy strong { overflow: hidden; color: #3f4d64; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.project-member-candidate-copy small { overflow: hidden; color: #929dad; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.project-members-foot span { font-size: 12px; }

/* Destructive actions stay compact, explicit, and consistent in every table. */
.row-delete,
.project-member-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #98a3b3;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, opacity .16s ease;
}
.row-delete { border: 1px solid #f2cdd1; background: #fff4f5; color: #c94e5a; opacity: 1; }
.task-row:hover .row-delete,
.row-delete:focus-visible { opacity: 1; }
.row-delete:hover,
.project-member-remove:hover { border-color: #e49ba2; background: #ffecee; color: #b83f4b; }
.row-delete:focus-visible,
.project-member-remove:focus-visible { outline: 2px solid #eaa2a9; outline-offset: 1px; }
.row-delete svg,
.project-member-remove svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project-member-identity { flex: 1 1 auto; }
.project-member-remove { flex: 0 0 32px; }
.project-member-remove:disabled { cursor: wait; opacity: .5; }
.project-member-protected { flex: 0 0 auto; min-width: 48px; color: #9aa5b5; font-size: 12px; text-align: right; }
.bulk-bar .bulk-delete { border-color: #c94e5a; background: #c94e5a; color: #fff; font-weight: 700; }
.bulk-bar .bulk-delete:hover { border-color: #b83f4b; background: #b83f4b; color: #fff; }

/* Keep selection actions out of document flow. They temporarily cover the
   board tabs, so selecting the first row never moves the table vertically. */
.board-card { position: relative; }
.board-card > .bulk-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 12;
  display: flex;
  height: 58px;
  min-height: 58px;
  min-width: 0;
  padding: 9px 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  box-shadow: 0 1px 0 #ddd9ff, 0 8px 22px rgba(49, 40, 112, .08);
}
.board-card > .bulk-bar strong,
.board-card > .bulk-bar button,
.board-card > .bulk-bar select { flex: 0 0 auto; }
.board-card > .bulk-bar .bulk-clear {
  position: sticky;
  right: 0;
  z-index: 1;
  margin-left: auto;
  box-shadow: -10px 0 12px #f7f5ff;
}
.detail-footer .danger-btn { padding: 9px 13px; border: 1px solid #efc4c8; border-radius: 8px; background: #fff1f2; color: #c54854; font-weight: 700; text-decoration: none; }
.detail-footer .danger-btn:hover { border-color: #df929a; background: #ffe8ea; color: #b43845; text-decoration: none; }

/* Keep both minute-precision timestamps readable while limiting the detail copy. */
.task-table { min-width: 1320px; }
.task-table th.task-col { width: 22%; }
.task-table th.detail-col { width: 12%; }
.task-table th.owner-col { width: 11%; }
.task-table th.status-col { width: 8%; }
.task-table th.start-col,
.task-table th.date-col { width: 138px; }
.task-table th.priority-col { width: 8%; }
.task-table th.dep-col { width: 10%; }
.task-table th.action-col { width: 68px; }
.task-table th.status-col,
.task-table td.status-cell,
.task-table th.start-col,
.task-table th.date-col,
.task-table td.date-table-cell { padding-left: 7px; padding-right: 7px; }
.task-table td.priority-table-cell { padding-left: 8px; padding-right: 8px; }
.task-table td.status-cell { text-align: center; }
.task-table td.status-cell .status-select-button { display: block; width: 100%; max-width: 108px; min-height: 34px; margin: 0 auto; padding: 6px 8px; }
.task-table td.date-table-cell .date-cell { gap: 5px; min-width: 0; white-space: nowrap; }
.task-table td.date-table-cell .date-icon { flex: 0 0 auto; font-size: 14px; }
.task-table td.date-table-cell .date-label { overflow: visible; color: #56657c; font-variant-numeric: tabular-nums; text-overflow: clip; }
.task-table th.action-col,
.task-table td:last-child { padding-left: 8px; padding-right: 18px; text-align: center; }

/* Reusable confirmation dialog; avoids browser/OS-dependent native prompts. */
.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 32, 46, .42);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease, visibility .16s ease;
}
.confirm-dialog-backdrop.open { opacity: 1; visibility: visible; }
.confirm-dialog {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid rgba(222, 227, 235, .94);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 26px 72px rgba(24, 34, 54, .24);
  transform: translateY(8px) scale(.985);
  transition: transform .16s ease;
}
.confirm-dialog-backdrop.open .confirm-dialog { transform: translateY(0) scale(1); }
.confirm-dialog-content { display: flex; align-items: flex-start; gap: 15px; }
.confirm-dialog-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px; background: #fff0f1; color: #c54854; }
.confirm-dialog-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm-dialog-copy { min-width: 0; padding-top: 1px; }
.confirm-dialog-copy h2 { margin: 0; color: #27344a; font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.confirm-dialog-copy p { margin: 8px 0 0; color: #68758a; font-size: 14px; line-height: 1.65; white-space: pre-line; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.confirm-dialog-actions button { min-width: 86px; min-height: 40px; padding: 9px 16px; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer; }
.confirm-dialog-cancel { border: 1px solid #dfe4ec; background: #fff; color: #5f6c81; }
.confirm-dialog-cancel:hover { border-color: #cbd2dd; background: #f7f8fa; color: #39475d; }
.confirm-dialog-submit { border: 1px solid #c54854; background: #c54854; color: #fff; box-shadow: 0 7px 16px rgba(197, 72, 84, .2); }
.confirm-dialog-submit:hover { border-color: #b33845; background: #b33845; }
.confirm-dialog[data-tone="primary"] .confirm-dialog-icon { background: #eeebff; color: #6656d6; }
.confirm-dialog[data-tone="primary"] .confirm-dialog-submit { border-color: #6656d6; background: #6656d6; box-shadow: 0 7px 16px rgba(102, 86, 214, .2); }
.confirm-dialog[data-tone="primary"] .confirm-dialog-submit:hover { border-color: #5647c5; background: #5647c5; }
.confirm-dialog-actions button:focus-visible { outline: 3px solid rgba(102, 86, 214, .22); outline-offset: 2px; }
@media (max-width: 520px) {
  .confirm-dialog { padding: 21px 18px 18px; }
  .confirm-dialog-actions button { flex: 1; }
}

/* Calendar and Gantt stay dense enough to scan while keeping labels readable. */
.flat-calendar.calendar-view { padding: 20px; }
.flat-calendar .calendar-toolbar { margin-bottom: 17px; }
.flat-calendar .calendar-toolbar h2 { font-size: 25px; }
.flat-calendar .calendar-subtitle { font-size: 13px; }
.flat-calendar .calendar-weekdays span { padding-bottom: 7px; font-size: 12px; }
.flat-calendar .calendar-day { min-height: 106px; padding: 9px; }
.flat-calendar .calendar-day-number { width: 27px; height: 27px; font-size: 13px; }
.flat-calendar .calendar-task { min-height: 26px; padding: 5px 7px; font-size: 12px; }
.flat-calendar .calendar-more { font-size: 12px; }
.gantt-view { padding: 20px; }
.gantt-toolbar { padding-bottom: 16px; }
.gantt-toolbar h2 { font-size: 26px; }
.gantt-toolbar p { font-size: 13px; }
.gantt-toolbar-actions label, .gantt-toolbar-actions select { font-size: 13px; }
.gantt-toolbar-actions select { padding: 8px 10px; }
.gantt-toolbar-actions .secondary-btn { font-size: 13px; }
.gantt-legend { gap: 13px; padding: 13px 0 11px; font-size: 12px; }
.gantt-label-head { height: 49px; font-size: 12px; }
.gantt-day-header { height: 49px; font-size: 11px; }
.gantt-day-header strong { font-size: 13px; }
.gantt-day-header small { font-size: 10px; }
.gantt-row { min-height: 58px; }
.gantt-task-label, .gantt-track { min-height: 58px; }
.gantt-task-copy strong { font-size: 13px; }
.gantt-task-copy small { font-size: 11px; }
.gantt-bar { top: 15px; height: 28px; }
.gantt-bar strong { font-size: 11px; }
.gantt-bar small { font-size: 10px; }
.gantt-empty { padding: 46px 20px; font-size: 14px; }
.gantt-empty strong { font-size: 15px; }

@media (max-width: 900px) {
  .main-content { padding-left: 22px; padding-right: 22px; }
  .project-heading { padding-top: 22px; }
  .insight-grid { gap: 10px; }
}
@media (max-width: 700px) {
  .main-content { padding-left: 14px; padding-right: 14px; }
  .project-heading h1 { font-size: 25px; }
  .project-heading p { font-size: 14px; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .heading-actions button { flex: 1 1 140px; }
  .insight-card { min-height: 88px; padding: 13px; }
  .insight-label { font-size: 12px; }
  .insight-value { font-size: 24px; }
  .notification-drawer { width: min(400px, 100%); }
  .task-detail-drawer { width: min(470px, 100%); }
  .flat-calendar.calendar-view, .gantt-view { padding: 16px 13px 20px; }
  .flat-calendar .calendar-day { min-height: 94px; padding: 7px; }
  .gantt-toolbar { align-items: flex-start; }
}

/* Gantt is a working surface: prioritize readable labels over decorative whitespace. */
.board-card > .toolbar[hidden],
.board-card > .bulk-bar[hidden],
.board-card > .table-wrap[hidden],
.board-card > .table-footer[hidden] { display: none !important; }
.gantt-view { padding: 18px 20px 22px; }
.gantt-toolbar { padding-bottom: 13px; }
.gantt-toolbar h2 { font-size: 29px; }
.gantt-toolbar p { margin-top: 4px; font-size: 14px; }
.gantt-toolbar-actions { gap: 10px; }
.gantt-toolbar-actions label { gap: 5px; font-size: 14px; }
.gantt-toolbar-actions select { min-width: 160px; padding: 9px 11px; font-size: 15px; }
.gantt-toolbar-actions .secondary-btn { padding: 9px 13px; font-size: 15px; }
.gantt-legend { padding: 11px 0 9px; font-size: 13px; }
.gantt-range { font-size: 13px; }
.gantt-label-head { height: 50px; padding: 0 16px; font-size: 14px; }
.gantt-day-header { height: 50px; font-size: 13px; }
.gantt-day-header strong { font-size: 15px; }
.gantt-day-header small { font-size: 11px; }
.gantt-row { min-height: 64px; }
.gantt-task-label, .gantt-track { min-height: 64px; }
.gantt-task-label { gap: 10px; padding: 9px 16px; }
.gantt-task-copy { gap: 2px; }
.gantt-task-copy strong { font-size: 15px; }
.gantt-task-copy small { font-size: 13px; }
.gantt-dependency-count { font-size: 13px; }
.gantt-bar { top: 17px; height: 30px; padding: 0 10px; }
.gantt-bar strong { font-size: 13px; }
.gantt-bar small { font-size: 11px; }
.gantt-group-label { height: 36px; padding: 0 16px; font-size: 13px; }
.gantt-group-label span:last-child { font-size: 12px; }
.gantt-empty { padding: 38px 20px; font-size: 15px; }
.gantt-empty strong { font-size: 16px; }
@media (max-width: 700px) {
  .gantt-view { padding: 15px 13px 18px; }
  .gantt-toolbar h2 { font-size: 26px; }
  .gantt-toolbar-actions label, .gantt-toolbar-actions select, .gantt-toolbar-actions .secondary-btn { font-size: 14px; }
  .gantt-label-head { padding-left: 11px; }
  .gantt-task-label { padding-left: 11px; }
}

/* Beijing-time current-day marker across the complete Gantt timeline. */
.gantt-board { position: relative; }
.gantt-day-header.today { position: relative; background: #fff1f2; color: #cc4653; }
.gantt-day-header.today strong { background: #d44f5c; color: #fff; }
.gantt-day-header.today small { color: #c94350; font-weight: 750; white-space: nowrap; }
.gantt-legend { flex-wrap: wrap; }
.gantt-beijing-today { margin-left: auto; padding: 5px 8px; border: 1px solid #f0c8cc; border-radius: 7px; background: #fff5f5; color: #bd414d; font-weight: 700; white-space: nowrap; }
.gantt-beijing-today i { width: 8px; height: 8px; border-radius: 50%; background: #d44f5c; box-shadow: 0 0 0 3px rgba(212, 79, 92, .12); }
.gantt-beijing-today + .gantt-range { margin-left: 0; }
.gantt-today-line { position: absolute; z-index: 1; top: 50px; bottom: 0; left: calc(280px + var(--today-position) * 38px); width: 1px; background: rgba(212, 79, 92, .42); pointer-events: none; }
.gantt-today-line::before { content: ''; position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: rgba(212, 79, 92, .58); transform: translateX(-50%); }
.gantt-bar { z-index: 2; }
@media (max-width: 700px) {
  .gantt-beijing-today { width: 100%; margin-left: 0; }
  .gantt-today-line { left: calc(220px + var(--today-position) * 38px); }
}
