* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  margin: 0;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", "Noto Sans", sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
}
.sidebar {
  background: #111827;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.brand {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 16px;
}
.brand-sub {
  color: #9ca3af;
  font-size: 12px;
  margin-top: -8px;
  margin-bottom: 12px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  color: #d1d5db;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.nav-group-header:hover {
  background: #1f2937;
  color: #fff;
}
.caret {
  font-size: 12px;
  transition: transform 0.2s ease;
}
.caret.collapsed {
  transform: rotate(-90deg);
}
.subnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid #1f2937;
}
.nav-item {
  color: #d1d5db;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-item:hover {
  background: #1f2937;
  color: #fff;
}
.nav-item.active {
  background: #2563eb;
  color: #fff;
}
.role {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.content {
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.title {
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 18px;
}
.actions {
  display: flex;
  gap: 8px;
}
.account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
}
.account .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.account .account-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.account .name {
  font-size: 12px;
  font-weight: 600;
}
.account .role-label {
  font-size: 12px;
  color: #6b7280;
}
.button {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}
button {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: background .2s ease, box-shadow .2s ease;
}
button:focus {
  box-shadow: 0 0 0 2px rgba(22,119,255,.2);
}
.primary {
  background: #2563eb;
  color: #fff;
}
.secondary {
  background: #e5e7eb;
  color: #111827;
}
.nav-item.disabled {
  pointer-events: none;
  opacity: 0.6;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.icon-btn {
  background: transparent;
  color: #111827;
  font-size: 18px;
  padding: 0 8px;
  position: relative;
}
#app {
  padding: 12px;
  overflow: auto;
}
.grid {
  display: grid;
  gap: 12px;
}
.grid-2 {
  grid-template-columns: 1fr 1fr;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
}
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.card-title {
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 16px;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.list-item .badge { margin-right: 6px; }
.toolbar .segmented { margin-left: 8px; }
.toolbar { margin-bottom: 6px; }
.tags { margin-top: 2px; }
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 12px;
  color: #6b7280;
}
.form-value {
  font-size: 14px;
  color: #1f2937;
}
.avatar-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.avatar-inline .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.avatar.small {
  width: 20px;
  height: 20px;
  font-size: 11px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.badge.count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  min-width: 16px;
  text-align: center;
}
.badge.red {
  background: #fee2e2;
  color: #991b1b;
}
.badge.yellow {
  background: #fef3c7;
  color: #92400e;
}
.badge.green {
  background: #dcfce7;
  color: #166534;
}
.badge.gray {
  background: #e5e7eb;
  color: #374151;
}
.muted {
  color: #6b7280;
}
.toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.input, .select {
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.modal {
  position: relative;
  z-index: 60;
  width: 520px;
  max-width: 90vw;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-body {
  padding: 12px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
}
.hidden {
  display: none;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
}
.table th {
  background: #f9fafb;
}
.segmented {
  display: inline-flex;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.segmented button {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  border-radius: 0;
}
.segmented button.active {
  background: #2563eb;
  color: #fff;
}
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kanban-column {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.kanban-column h4 {
  margin: 0 0 8px 0;
}
.quick-entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.quick-entry-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--antd-border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #1f2937;
  text-decoration: none;
}
.quick-entry-item:hover {
  border-color: var(--antd-primary);
}
.quick-entry-item .menu-icon svg {
  width: 18px;
  height: 18px;
  color: var(--antd-primary);
}
.kanban-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background: #f9fafb;
}
.resource-card {
  position: relative;
}
.resource-card .avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}
.resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.resource-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffa39e;
}
.schedule {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.empty-schedule {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px dashed var(--antd-border);
  border-radius: 8px;
  background: #fff;
}
.empty-schedule .icon svg {
  width: 24px;
  height: 24px;
}
.schedule-item {
  border: 1px solid var(--antd-border);
  border-radius: 8px;
  padding: 8px 10px;
  position: relative;
}
.schedule-item.running {
  background: #fff1f0;
  border-color: #ffa39e;
}
.schedule-item.running .title,
.schedule-item.running .meta {
  color: #cf1322;
}
.schedule-item.booked {
  background: #e6f4ff;
  border-color: #91caff;
}
.schedule-item.booked .title,
.schedule-item.booked .meta {
  color: #0958d9;
}
.schedule-item .title {
  font-weight: 600;
}
.schedule-item .meta {
  font-size: 12px;
  color: #6b7280;
}
.schedule-item .chip {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ffffff;
  border: 1px solid var(--antd-border);
}
.schedule-item.running .chip {
  color: #cf1322;
  border-color: #ffa39e;
}
.schedule-item.booked .chip {
  color: #0958d9;
  border-color: #91caff;
}
.phase-item .phase-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.phase-icon svg {
  width: 20px;
  height: 20px;
}
.phase-icon.done { color: #22c55e; }
.phase-icon.doing { color: #1677ff; }
.phase-icon.todo { color: #d1d5db; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.chip.doing { background: #e6f4ff; color: #0958d9; }
.chip.done { background: #f6ffed; color: #135200; }
.chip.todo { background: #f5f5f5; color: #8c8c8c; }
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.role-badge .role-icon svg {
  width: 16px;
  height: 16px;
  color: #8c8c8c;
}
.project-card .kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 6px;
}
.stage-box {
  background: #f5f5f5;
  border: 1px solid var(--antd-border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.stage-box .stage-name {
  font-weight: 600;
  color: #1f2937;
}
.progress-wrap {
  margin: 8px 0;
}
.progress {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--antd-primary);
  border-radius: 999px;
  transition: width .2s ease;
}
.busy-cell {
  background: #fff1f0;
  color: #cf1322;
}
.timeline {
  display: block;
  width: 100%;
}
.timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}
.timeline-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.timeline-name {
  font-size: 13px;
  color: #374151;
}
.timeline-track {
  position: relative;
  height: 28px;
  background: #f5f5f5;
  border: 1px solid var(--antd-border);
  border-radius: 6px;
  overflow: hidden;
}
.timeline-bar {
  position: absolute;
  top: 2px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  color: #111827;
}
.timeline-bar.running {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #cf1322;
}
.timeline-bar.booked {
  background: #e6f4ff;
  border: 1px solid #91caff;
  color: #0958d9;
}
.timeline-bar .bar-label {
  white-space: nowrap;
}
/* overrides */
:root {
  --bg: #f5f7fb;
  --text: #111827;
  --border: #e5e7eb;
  --card: #ffffff;
  --sidebar: #0b1220;
  --sidebar-hover: #152036;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #ef4444;
}
html, body { color: var(--text); background: var(--bg); }
.brand { color: #e5e7eb; }
.sidebar { background: var(--sidebar); color: #d1d5db; }
.nav-group-header { color: #e5e7eb; }
.nav-group-header:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item { transition: background .2s ease,color .2s ease; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.title { font-size: 16px; }
.primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.primary:hover { background: var(--primary-hover); }
.secondary {
  background: #eef2ff;
  color: #1e293b;
  border: 1px solid #e0e7ff;
}
.icon-btn { color: #1f2937; }
.card { background: var(--card); border: 1px solid var(--border); box-shadow: 0 4px 10px rgba(17,24,39,.06); }
.card-title { display: flex; align-items: center; gap: 8px; }
.list-item { background: #fafafa; transition: background .2s ease,border-color .2s ease; }
.list-item:hover { background: #f4f7ff; border-color: #dbe4ff; }
.badge.count { background: var(--danger); }
.table th, .table td { border: 1px solid var(--border); }
.table tbody tr:nth-child(even) { background: #f8fafc; }
.segmented { border: 1px solid var(--border); }
.segmented button { border-right: 1px solid var(--border); }
.segmented button.active { background: var(--primary); color: #fff; font-weight: 600; }
.kanban-column { background: var(--card); border: 1px solid var(--border); box-shadow: 0 4px 10px rgba(17,24,39,.06); }
.kanban-item { border: 1px solid var(--border); transition: background .2s ease,border-color .2s ease; }
.kanban-item:hover { background: #f4f7ff; border-color: #dbe4ff; }
.nav-item .icon { width: 18px; display: inline-flex; align-items: center; justify-content: center; }
.nav-item.disabled { pointer-events: none; opacity: 0.6; }
.nav-item.disabled:hover { background: transparent; color: #d1d5db; }
.btn-link { color: #1677ff; background: transparent; border: none; padding: 0; }
.btn-link:hover { color: #4096ff; }

/* Ant Design theme (prototype) */
:root {
  --antd-primary: #1677ff;
  --antd-primary-hover: #4096ff;
  --antd-bg: #f5f5f5;
  --antd-border: #f0f0f0;
  --antd-card: #ffffff;
}
html, body { background: var(--antd-bg); }
.topbar { background: var(--antd-card); border-bottom: 1px solid var(--antd-border); }
.card { background: var(--antd-card); border: 1px solid var(--antd-border); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.primary { background: var(--antd-primary); }
.primary:hover { background: var(--antd-primary-hover); }
.secondary { background: #f5f5f5; color: #1f2937; border: 1px solid var(--antd-border); }
.nav-item.active { background: #e6f4ff; color: var(--antd-primary); font-weight: 600; }
.nav-group-header:hover { background: #1a253a; }
.table th { background: #fafafa; }
.table tbody tr:hover { background: #fafafa; }
.segmented { background: transparent; border: none; }
.segmented button { background: transparent; border-right: none; padding: 8px 12px; color: #6b7280; }
.segmented button.active { background: transparent; color: #111827; box-shadow: inset 0 -2px 0 var(--antd-primary); }
.segmented .menu-icon { margin-right: 6px; display: inline-flex; align-items: center; }
.segmented .menu-icon svg { width: 16px; height: 16px; }
.segmented button.active .menu-icon svg { color: var(--antd-primary); }
.badge.red { background: #ffccc7; color: #a8071a; border-color: #ffa39e; }
.badge.yellow { background: #fff1b8; color: #d48806; border-color: #ffe58f; }
.badge.green { background: #f6ffed; color: #135200; border-color: #b7eb8f; }
.badge.blue { background: #e6f4ff; color: #0958d9; border-color: #91caff; }

/* Notification badge positioning */
.notif {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.notif .badge.count {
  position: absolute;
  top: -4px;
  right: -4px;
}
.notif .secondary {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--antd-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif .secondary:hover {
  border-color: var(--antd-primary);
}
.notif .menu-icon {
  margin: 0;
}
.count-strong {
  font-weight: 700;
}

/* Light sidebar override */
.sidebar {
  background: #ffffff;
  color: #1f2937;
  border-right: 1px solid var(--antd-border);
}

/* Error Page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 32px;
}
.error-icon {
  width: 64px;
  height: 64px;
  color: #d1d5db;
  margin-bottom: 24px;
}
.error-icon svg {
  width: 100%;
  height: 100%;
}
.error-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}
.error-desc {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}
.brand { color: #1f2937; }
.brand-sub { color: #8c8c8c; }
.nav-group-header {
  color: #1f2937;
  background: transparent;
}
.nav-group-header:hover {
  background: #f5f5f5;
  color: #1f2937;
}
.subnav {
  border-left: 1px solid var(--antd-border);
}
.nav-item {
  color: #434343;
  font-size: 14px;
  width: 100%;
}
.nav-item:hover {
  background: #f5f5f5;
  color: #1f2937;
}
.nav-group-header {
  font-size: 14px;
}
.menu-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}
.menu-icon svg {
  width: 16px;
  height: 16px;
}
.nav-item.disabled .menu-icon svg {
  opacity: 0.6;
}
.subnav .nav-item, .subnav .nav-item span {
  text-align: left;
  justify-content: flex-start;
}

/* Tags (preview labels) */
.tags {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--antd-border);
  background: #fafafa;
  color: #434343;
}
.tag.blue { background: #e6f4ff; color: #0958d9; border-color: #91caff; }
.tag.gold { background: #fffbe6; color: #ad6800; border-color: #ffe58f; }
.tag.red { background: #fff1f0; color: #cf1322; border-color: #ffa39e; }
.tag.green { background: #f6ffed; color: #135200; border-color: #b7eb8f; }
.calendar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.calendar-weekday {
  padding: 8px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}
.calendar-day {
  min-height: 110px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 8px;
  background: #fff;
}
.calendar-day:nth-child(7n) {
  border-right: none;
}
.calendar-day .date {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}
.calendar-event {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 6px;
  background: #f9fafb;
  font-size: 12px;
  cursor: pointer;
}
.calendar-event .meta {
  color: #6b7280;
  margin-left: 6px;
}
.calendar-period {
  display: block;
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 6px;
  background: #eef2ff;
  font-size: 12px;
  color: #1e293b;
  border: 1px solid #e0e7ff;
  cursor: pointer;
}
